diff options
66 files changed, 5298 insertions, 741 deletions
diff --git a/crypto/TestResult.xml b/crypto/TestResult.xml new file mode 100644 index 000000000..047a66cb3 --- /dev/null +++ b/crypto/TestResult.xml @@ -0,0 +1,1985 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!--This file represents the results of running a test suite--> +<test-results name="C:\Users\Peter\My Code\bc\git\bc-csharp\crypto\testcfg.nunit" total="703" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2015-03-09" time="21:14:56"> + <environment nunit-version="2.6.2.12296" clr-version="2.0.50727.5485" os-version="Microsoft Windows NT 6.1.7601 Service Pack 1" platform="Win32NT" cwd="C:\Users\Peter\My Code\bc\git\bc-csharp\crypto" machine-name="CERAMIC" user="Peter" user-domain="Ceramic" /> + <culture-info current-culture="en-AU" current-uiculture="en-US" /> + <test-suite type="Project" name="C:\Users\Peter\My Code\bc\git\bc-csharp\crypto\testcfg.nunit" executed="True" result="Success" success="True" time="528.916" asserts="0"> + <results> + <test-suite type="Assembly" name="C:\Users\Peter\My Code\bc\git\bc-csharp\crypto\./test/bin/BCTest.dll" executed="True" result="Success" success="True" time="528.899" asserts="0"> + <results> + <test-suite type="Namespace" name="Org" executed="True" result="Success" success="True" time="528.899" asserts="0"> + <results> + <test-suite type="Namespace" name="BouncyCastle" executed="True" result="Success" success="True" time="528.899" asserts="0"> + <results> + <test-suite type="Namespace" name="Asn1" executed="True" result="Success" success="True" time="0.849" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.849" asserts="0"> + <results> + <test-suite type="TestFixture" name="AdditionalInformationSyntaxUnitTest" executed="True" result="Success" success="True" time="0.060" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.AdditionalInformationSyntaxUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.047" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AdmissionsUnitTest" executed="True" result="Success" success="True" time="0.062" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.AdmissionsUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.062" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AdmissionSyntaxUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.AdmissionSyntaxUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Asn1SequenceParserTest" executed="True" result="Success" success="True" time="0.060" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestBerExplicitTaggedSequenceWriting" executed="True" result="Success" success="True" time="0.018" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestBerReading" executed="True" result="Success" success="True" time="0.015" asserts="4" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestBerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestDerExplicitTaggedSequenceWriting" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestDerImplicitTaggedSequenceWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestDerReading" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestDerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedBerDerReading" executed="True" result="Success" success="True" time="0.001" asserts="5" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedBerDerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedBerReading" executed="True" result="Success" success="True" time="0.001" asserts="5" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedBerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedDerReading" executed="True" result="Success" success="True" time="0.001" asserts="5" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedDerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedExplicitTagDerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestNestedImplicitTagDerWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.Asn1SequenceParserTest.TestSequenceWithDerNullReading" executed="True" result="Success" success="True" time="0.001" asserts="5" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AttributeTableUnitTest" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.AttributeTableUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="BiometricDataUnitTest" executed="True" result="Success" success="True" time="0.013" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.BiometricDataUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.012" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="BitStringTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.BitStringTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertHashUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CertHashUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertificateTest" executed="True" result="Success" success="True" time="0.058" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CertificateTest.TestFunction" executed="True" result="Success" success="True" time="0.057" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CmsTest" executed="True" result="Success" success="True" time="0.050" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CmsTest.TestFunction" executed="True" result="Success" success="True" time="0.049" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CommitmentTypeIndicationUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CommitmentTypeIndicationUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CommitmentTypeQualifierUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CommitmentTypeQualifierUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ContentHintsUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.ContentHintsUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CscaMasterListTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.CscaMasterListTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DataGroupHashUnitTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.DataGroupHashUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DeclarationOfMajorityUnitTest" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.DeclarationOfMajorityUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.007" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DerApplicationSpecificTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.DerApplicationSpecificTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DerUtf8StringTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.DerUtf8StringTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EncryptedPrivateKeyInfoTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.EncryptedPrivateKeyInfoTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EnumeratedTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.EnumeratedTest.TestReadingMultipleDoubleByteItems" executed="True" result="Success" success="True" time="0.002" asserts="6" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.EnumeratedTest.TestReadingMultipleSingleByteItems" executed="True" result="Success" success="True" time="0.001" asserts="6" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.EnumeratedTest.TestReadingMultipleTripleByteItems" executed="True" result="Success" success="True" time="0.001" asserts="6" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EqualsAndHashCodeTest" executed="True" result="Success" success="True" time="0.019" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.EqualsAndHashCodeTest.TestFunction" executed="True" result="Success" success="True" time="0.018" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EssCertIDv2UnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.EssCertIDv2UnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GeneralizedTimeTest" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.GeneralizedTimeTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GeneralNameTest" executed="True" result="Success" success="True" time="0.011" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.GeneralNameTest.TestFunction" executed="True" result="Success" success="True" time="0.010" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GenerationTest" executed="True" result="Success" success="True" time="0.037" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.GenerationTest.TestFunction" executed="True" result="Success" success="True" time="0.035" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="InputStreamTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.InputStreamTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Iso4217CurrencyCodeUnitTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.Iso4217CurrencyCodeUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="IssuingDistributionPointUnitTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.IssuingDistributionPointUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="KeyUsageTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.KeyUsageTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="LDSSecurityObjectUnitTest" executed="True" result="Success" success="True" time="0.010" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.LDSSecurityObjectUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MiscTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.MiscTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MonetaryLimitUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.MonetaryLimitUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MonetaryValueUnitTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.MonetaryValueUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NameOrPseudonymUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.NameOrPseudonymUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NamingAuthorityUnitTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.NamingAuthorityUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NetscapeCertTypeTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.NetscapeCertTypeTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OcspTest" executed="True" result="Success" success="True" time="0.016" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.OcspTest.TestFunction" executed="True" result="Success" success="True" time="0.015" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OctetStringTest" executed="True" result="Success" success="True" time="0.011" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.OctetStringTest.TestNestedStructure" executed="True" result="Success" success="True" time="0.006" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.OctetStringTest.TestReadingWriting" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.OctetStringTest.TestReadingWritingNested" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.OctetStringTest.TestReadingWritingZeroInLength" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OidTest" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.OidTest.TestFunction" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OtherCertIDUnitTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.OtherCertIDUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OtherSigningCertificateUnitTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.OtherSigningCertificateUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ParseTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.ParseTest.TestClassCast" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.ParseTest.TestDerExp" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Asn1.Tests.ParseTest.TestLongTag" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PersonalDataUnitTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.PersonalDataUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs10Test" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.Pkcs10Test.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs12Test" executed="True" result="Success" success="True" time="0.014" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.Pkcs12Test.TestFunction" executed="True" result="Success" success="True" time="0.013" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PkiFailureInfoTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.PkiFailureInfoTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ProcurationSyntaxUnitTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.ProcurationSyntaxUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ProfessionInfoUnitTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.ProfessionInfoUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="QCStatementUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.QCStatementUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ReasonFlagsTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.ReasonFlagsTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RequestedCertificateUnitTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.RequestedCertificateUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RestrictionUnitTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.RestrictionUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SemanticsInformationUnitTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.SemanticsInformationUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SetTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.SetTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SignerLocationUnitTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.SignerLocationUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.006" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SmimeTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.SmimeTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="StringTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.StringTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SubjectKeyIdentifierTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.SubjectKeyIdentifierTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TagTest" executed="True" result="Success" success="True" time="0.024" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.TagTest.TestFunction" executed="True" result="Success" success="True" time="0.024" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TargetInformationTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.TargetInformationTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TimeTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.TimeTest.CheckCmsTimeVsX509Time" executed="True" result="Success" success="True" time="0.003" asserts="2" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TypeOfBiometricDataUnitTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.TypeOfBiometricDataUnitTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="UtcTimeTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.UtcTimeTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X509ExtensionsTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.X509ExtensionsTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X509NameTest" executed="True" result="Success" success="True" time="0.021" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.X509NameTest.TestFunction" executed="True" result="Success" success="True" time="0.020" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X9Test" executed="True" result="Success" success="True" time="0.089" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Asn1.Tests.X9Test.TestFunction" executed="True" result="Success" success="True" time="0.088" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Bcpg" executed="True" result="Success" success="True" time="40.881" asserts="0"> + <results> + <test-suite type="Namespace" name="OpenPgp" executed="True" result="Success" success="True" time="40.880" asserts="0"> + <results> + <test-suite type="Namespace" name="Examples" executed="True" result="Success" success="True" time="5.412" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="5.412" asserts="0"> + <results> + <test-suite type="TestFixture" name="AllTests" executed="True" result="Success" success="True" time="5.412" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests.AllTests.TestClearSigned" executed="True" result="Success" success="True" time="0.565" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests.AllTests.TestClearSignedBogusInput" executed="True" result="Success" success="True" time="0.017" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests.AllTests.TestDsaElGamalKeyGeneration" executed="True" result="Success" success="True" time="4.150" asserts="16" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests.AllTests.TestPbeEncryption" executed="True" result="Success" success="True" time="0.042" asserts="3" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests.AllTests.TestRsaKeyGeneration" executed="True" result="Success" success="True" time="0.635" asserts="16" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="35.466" asserts="0"> + <results> + <test-suite type="TestFixture" name="Dsa2Test" executed="True" result="Success" success="True" time="4.120" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK1024H224" executed="True" result="Success" success="True" time="0.022" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK1024H256" executed="True" result="Success" success="True" time="0.013" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK1024H384" executed="True" result="Success" success="True" time="0.020" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK1024H512" executed="True" result="Success" success="True" time="0.014" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK2048H256" executed="True" result="Success" success="True" time="0.048" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestGenerateK2048H512" executed="True" result="Success" success="True" time="0.056" asserts="5" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK1024H160" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK1024H224" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK1024H256" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK1024H384" executed="True" result="Success" success="True" time="0.007" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK1024H512" executed="True" result="Success" success="True" time="0.007" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK15360H512" executed="True" result="Success" success="True" time="3.196" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK2048H224" executed="True" result="Success" success="True" time="0.030" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK3072H256" executed="True" result="Success" success="True" time="0.072" asserts="1" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.Dsa2Test.TestK7680H384" executed="True" result="Success" success="True" time="0.599" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpArmoredTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpArmoredTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpClearSignedSignatureTest" executed="True" result="Success" success="True" time="0.144" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpClearSignedSignatureTest.TestFunction" executed="True" result="Success" success="True" time="0.143" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpCompressionTest" executed="True" result="Success" success="True" time="0.057" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpCompressionTest.TestBZip2" executed="True" result="Success" success="True" time="0.052" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpCompressionTest.TestUncompressed" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpCompressionTest.TestZip" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpCompressionTest.TestZLib" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpDsaElGamalTest" executed="True" result="Success" success="True" time="0.923" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpDsaElGamalTest.TestFunction" executed="True" result="Success" success="True" time="0.922" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpDsaTest" executed="True" result="Success" success="True" time="0.213" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpDsaTest.TestFunction" executed="True" result="Success" success="True" time="0.212" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpKeyRingTest" executed="True" result="Success" success="True" time="0.892" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.GenerateSha1Test" executed="True" result="Success" success="True" time="0.522" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.GenerateTest" executed="True" result="Success" success="True" time="0.155" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.InsertMasterTest" executed="True" result="Success" success="True" time="0.100" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest1" executed="True" result="Success" success="True" time="0.011" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest10" executed="True" result="Success" success="True" time="0.004" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest11" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest2" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest3" executed="True" result="Success" success="True" time="0.008" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest4" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest5" executed="True" result="Success" success="True" time="0.010" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest6" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest8" executed="True" result="Success" success="True" time="0.014" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PerformTest9" executed="True" result="Success" success="True" time="0.008" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.PublicKeyRingWithX509Test" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.RewrapTest" executed="True" result="Success" success="True" time="0.005" asserts="0" /> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpKeyRingTest.SecretKeyRingWithPersonalCertificateTest" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpMarkerTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpMarkerTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PGPNoPrivateKeyTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PGPNoPrivateKeyTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpPacketTest" executed="True" result="Success" success="True" time="27.842" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpPacketTest.TestFunction" executed="True" result="Success" success="True" time="27.841" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpPbeTest" executed="True" result="Success" success="True" time="0.053" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpPbeTest.TestFunction" executed="True" result="Success" success="True" time="0.052" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpRsaTest" executed="True" result="Success" success="True" time="0.965" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpRsaTest.TestFunction" executed="True" result="Success" success="True" time="0.964" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PgpSignatureTest" executed="True" result="Success" success="True" time="0.237" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Bcpg.OpenPgp.Tests.PgpSignatureTest.TestFunction" executed="True" result="Success" success="True" time="0.236" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Cms" executed="True" result="Success" success="True" time="5.033" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="5.033" asserts="0"> + <results> + <test-suite type="TestFixture" name="AuthenticatedDataStreamTest" executed="True" result="Success" success="True" time="0.636" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataStreamTest.TestKeyTransDESede" executed="True" result="Success" success="True" time="0.635" asserts="5" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AuthenticatedDataTest" executed="True" result="Success" success="True" time="0.419" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataTest.TestECKeyAgree" executed="True" result="Success" success="True" time="0.248" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataTest.TestEncoding" executed="True" result="Success" success="True" time="0.121" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataTest.TestKEKDESede" executed="True" result="Success" success="True" time="0.011" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataTest.TestKeyTransDESede" executed="True" result="Success" success="True" time="0.010" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.AuthenticatedDataTest.TestPasswordAES256" executed="True" result="Success" success="True" time="0.027" asserts="4" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CompressedDataStreamTest" executed="True" result="Success" success="True" time="0.043" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataStreamTest.Test1000" executed="True" result="Success" success="True" time="0.039" asserts="10" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataStreamTest.TestEach" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataStreamTest.TestWorkingData" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CompressedDataTest" executed="True" result="Success" success="True" time="0.011" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataTest.TestEach" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataTest.TestLimitEqual" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataTest.TestLimitOver" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataTest.TestLimitUnder" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.CompressedDataTest.TestWorkingData" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EnvelopedDataStreamTest" executed="True" result="Success" success="True" time="0.503" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestAesKek" executed="True" result="Success" success="True" time="0.014" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestECKeyAgree" executed="True" result="Success" success="True" time="0.220" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestKeyTransAes128" executed="True" result="Success" success="True" time="0.174" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestKeyTransAes128Buffered" executed="True" result="Success" success="True" time="0.021" asserts="7" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestKeyTransAes128BufferedStream" executed="True" result="Success" success="True" time="0.019" asserts="7" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestKeyTransAes128Der" executed="True" result="Success" success="True" time="0.010" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestKeyTransAes128Throughput" executed="True" result="Success" success="True" time="0.020" asserts="12" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestOriginatorInfo" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestTwoAesKek" executed="True" result="Success" success="True" time="0.002" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataStreamTest.TestWorkingData" executed="True" result="Success" success="True" time="0.015" asserts="3" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EnvelopedDataTest" executed="True" result="Success" success="True" time="0.666" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestAes128Kek" executed="True" result="Success" success="True" time="0.007" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestAes192Kek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestAes256Kek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestCamellia128Kek" executed="True" result="Success" success="True" time="0.018" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestCamellia192Kek" executed="True" result="Success" success="True" time="0.003" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestCamellia256Kek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestDesKek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestECKeyAgree" executed="True" result="Success" success="True" time="0.101" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestECKeyAgreeVectors" executed="True" result="Success" success="True" time="0.062" asserts="12" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestECMqvKeyAgree" executed="True" result="Success" success="True" time="0.058" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestECMqvKeyAgreeMultiple" executed="True" result="Success" success="True" time="0.098" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestECMqvKeyAgreeVectors" executed="True" result="Success" success="True" time="0.019" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestErroneousKek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTrans" executed="True" result="Success" success="True" time="0.143" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTrans128RC4" executed="True" result="Success" success="True" time="0.013" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransAes128" executed="True" result="Success" success="True" time="0.010" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransAes192" executed="True" result="Success" success="True" time="0.008" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransAes256" executed="True" result="Success" success="True" time="0.009" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransCast5" executed="True" result="Success" success="True" time="0.012" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransOdes" executed="True" result="Success" success="True" time="0.011" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransRC4" executed="True" result="Success" success="True" time="0.010" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransSeed" executed="True" result="Success" success="True" time="0.014" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestKeyTransSmallAes" executed="True" result="Success" success="True" time="0.009" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestOriginatorInfo" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestPasswordAes256" executed="True" result="Success" success="True" time="0.005" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestPasswordDesEde" executed="True" result="Success" success="True" time="0.002" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestRC2128Kek" executed="True" result="Success" success="True" time="0.014" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestRfc4134Ex5_1" executed="True" result="Success" success="True" time="0.008" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestRfc4134Ex5_2" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.EnvelopedDataTest.TestSeed128Kek" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MiscDataStreamTest" executed="True" result="Success" success="True" time="0.715" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.MiscDataStreamTest.TestSha1WithRsa" executed="True" result="Success" success="True" time="0.715" asserts="2" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Rfc4134Test" executed="True" result="Success" success="True" time="0.149" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_1" executed="True" result="Success" success="True" time="0.022" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_2" executed="True" result="Success" success="True" time="0.004" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_3" executed="True" result="Success" success="True" time="0.014" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_4" executed="True" result="Success" success="True" time="0.020" asserts="11" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_5" executed="True" result="Success" success="True" time="0.003" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_6" executed="True" result="Success" success="True" time="0.028" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test4_7" executed="True" result="Success" success="True" time="0.014" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test5_1" executed="True" result="Success" success="True" time="0.022" asserts="16" /> + <test-case name="Org.BouncyCastle.Cms.Tests.Rfc4134Test.Test5_2" executed="True" result="Success" success="True" time="0.016" asserts="18" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SignedDataStreamTest" executed="True" result="Success" success="True" time="0.679" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestAttributeGenerators" executed="True" result="Success" success="True" time="0.431" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestCertOrdering1" executed="True" result="Success" success="True" time="0.010" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestCertOrdering2" executed="True" result="Success" success="True" time="0.009" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestCertsOnly" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestCertStoreReplacement" executed="True" result="Success" success="True" time="0.024" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestEarlyInvalidKeyException" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestEarlyNoSuchAlgorithmException" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestEncapsulatedCertStoreReplacement" executed="True" result="Success" success="True" time="0.010" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestEncapsulatedSignerStoreReplacement" executed="True" result="Success" success="True" time="0.021" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1AndMD5WithRsa" executed="True" result="Success" success="True" time="0.019" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1EncapsulatedSignature" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsa" executed="True" result="Success" success="True" time="0.028" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.013" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsaEncapsulatedBuffered" executed="True" result="Success" success="True" time="0.019" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsaEncapsulatedBufferedStream" executed="True" result="Success" success="True" time="0.020" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsaEncapsulatedSubjectKeyID" executed="True" result="Success" success="True" time="0.014" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSha1WithRsaNonData" executed="True" result="Success" success="True" time="0.010" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestSignerStoreReplacement" executed="True" result="Success" success="True" time="0.020" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataStreamTest.TestWithAttributeCertificate" executed="True" result="Success" success="True" time="0.016" asserts="3" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SignedDataTest" executed="True" result="Success" success="True" time="1.200" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestCertOrdering1" executed="True" result="Success" success="True" time="0.254" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestCertOrdering2" executed="True" result="Success" success="True" time="0.009" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestCertStoreReplacement" executed="True" result="Success" success="True" time="0.012" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestCounterSig" executed="True" result="Success" success="True" time="0.004" asserts="4" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestDetachedVerification" executed="True" result="Success" success="True" time="0.019" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestDsaEncapsulated" executed="True" result="Success" success="True" time="0.022" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestDsaEncapsulatedSubjectKeyID" executed="True" result="Success" success="True" time="0.012" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaEncapsulated" executed="True" result="Success" success="True" time="0.070" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaEncapsulatedSubjectKeyID" executed="True" result="Success" success="True" time="0.052" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaSha224Encapsulated" executed="True" result="Success" success="True" time="0.052" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaSha256Encapsulated" executed="True" result="Success" success="True" time="0.052" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaSha384Encapsulated" executed="True" result="Success" success="True" time="0.052" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaSha512Encapsulated" executed="True" result="Success" success="True" time="0.054" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestECDsaSha512EncapsulatedWithKeyFactoryAsEC" executed="True" result="Success" success="True" time="0.063" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestEncapsulatedCertStoreReplacement" executed="True" result="Success" success="True" time="0.010" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestEncapsulatedSamples" executed="True" result="Success" success="True" time="0.017" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestForMultipleCounterSignatures" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestGost3411WithECGost3410Encapsulated" executed="True" result="Success" success="True" time="0.075" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestGost3411WithGost3410Encapsulated" executed="True" result="Success" success="True" time="0.059" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestNullContentWithSigner" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestRipeMD128WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.025" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestRipeMD160WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.038" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestRipeMD256WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.024" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSamples" executed="True" result="Success" success="True" time="0.011" asserts="3" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1AndMD5WithRsaEncapsulatedRepeated" executed="True" result="Success" success="True" time="0.023" asserts="11" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1WithRsaAndAttributeTable" executed="True" result="Success" success="True" time="0.011" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1WithRsaCounterSignature" executed="True" result="Success" success="True" time="0.027" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.012" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1WithRsaEncapsulatedSubjectKeyID" executed="True" result="Success" success="True" time="0.012" asserts="6" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha1WithRsaPss" executed="True" result="Success" success="True" time="0.013" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha224WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.012" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha224WithRsaPss" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha256WithRsaEncapsulated" executed="True" result="Success" success="True" time="0.012" asserts="5" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha256WithRsaPss" executed="True" result="Success" success="True" time="0.009" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSha384WithRsaPss" executed="True" result="Success" success="True" time="0.009" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestSignerStoreReplacement" executed="True" result="Success" success="True" time="0.019" asserts="2" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestUnsortedAttributes" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Cms.Tests.SignedDataTest.TestWithAttributeCertificate" executed="True" result="Success" success="True" time="0.011" asserts="4" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Crypto" executed="True" result="Success" success="True" time="167.945" asserts="0"> + <results> + <test-suite type="Namespace" name="IO" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-suite type="TestFixture" name="CipherStreamTest" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.IO.Tests.CipherStreamTest.TestEncryptDecryptA" executed="True" result="Success" success="True" time="0.004" asserts="4" /> + <test-case name="Org.BouncyCastle.Crypto.IO.Tests.CipherStreamTest.TestEncryptDecryptB" executed="True" result="Success" success="True" time="0.001" asserts="3" /> + <test-case name="Org.BouncyCastle.Crypto.IO.Tests.CipherStreamTest.TestEncryptDecryptC" executed="True" result="Success" success="True" time="0.000" asserts="4" /> + <test-case name="Org.BouncyCastle.Crypto.IO.Tests.CipherStreamTest.TestEncryptDecryptD" executed="True" result="Success" success="True" time="0.001" asserts="3" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="165.286" asserts="0"> + <results> + <test-suite type="TestFixture" name="AesFastTest" executed="True" result="Success" success="True" time="0.224" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.AesFastTest.TestFunction" executed="True" result="Success" success="True" time="0.220" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AesLightTest" executed="True" result="Success" success="True" time="0.546" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.AesLightTest.TestFunction" executed="True" result="Success" success="True" time="0.542" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AesTest" executed="True" result="Success" success="True" time="0.346" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.AesTest.TestFunction" executed="True" result="Success" success="True" time="0.342" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AesWrapTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.AesWrapTest.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AllTests" executed="True" result="Success" success="True" time="102.293" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.AllTests.TestCrypto" executed="True" result="Success" success="True" time="102.293" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="BlowfishTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.BlowfishTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CamelliaLightTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.CamelliaLightTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CamelliaTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.CamelliaTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Cast5Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Cast5Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Cast6Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Cast6Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CcmTest" executed="True" result="Success" success="True" time="0.035" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.CcmTest.TestFunction" executed="True" result="Success" success="True" time="0.035" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ChaChaTest" executed="True" result="Success" success="True" time="0.009" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ChaChaTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.CMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CTSTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.CTSTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DesEdeTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DesEdeTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DesTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DesTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DeterministicDsaTest" executed="True" result="Success" success="True" time="0.741" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DeterministicDsaTest.TestFunction" executed="True" result="Success" success="True" time="0.741" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DHKekGeneratorTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DHKekGeneratorTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DHTest" executed="True" result="Success" success="True" time="0.406" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DHTest.TestFunction" executed="True" result="Success" success="True" time="0.405" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DigestRandomNumberTest" executed="True" result="Success" success="True" time="11.452" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DigestRandomNumberTest.TestFunction" executed="True" result="Success" success="True" time="11.452" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DsaTest" executed="True" result="Success" success="True" time="24.561" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.DsaTest.TestFunction" executed="True" result="Success" success="True" time="24.561" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EaxTest" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.EaxTest.TestFunction" executed="True" result="Success" success="True" time="0.007" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECDHKekGeneratorTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECDHKekGeneratorTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECGost3410Test" executed="True" result="Success" success="True" time="0.134" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECGost3410Test.TestFunction" executed="True" result="Success" success="True" time="0.133" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EcIesTest" executed="True" result="Success" success="True" time="0.053" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.EcIesTest.TestFunction" executed="True" result="Success" success="True" time="0.053" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EcNrTest" executed="True" result="Success" success="True" time="0.028" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.EcNrTest.TestFunction" executed="True" result="Success" success="True" time="0.028" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECTest" executed="True" result="Success" success="True" time="0.375" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestDecode" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECBasicAgreementTest" executed="True" result="Success" success="True" time="0.060" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsa191bitBinary" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsa192bitPrime" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsa239bitBinary" executed="True" result="Success" success="True" time="0.021" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsa239bitBinaryAndLargeDigest" executed="True" result="Success" success="True" time="0.020" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsa239bitPrime" executed="True" result="Success" success="True" time="0.027" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaKeyGenTest" executed="True" result="Success" success="True" time="0.031" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaP224OneByteOver" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaP224Sha224" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaP256Sha256" executed="True" result="Success" success="True" time="0.018" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaP521Sha512" executed="True" result="Success" success="True" time="0.040" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECDsaSecP224k1Sha256" executed="True" result="Success" success="True" time="0.008" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECMqvRandom" executed="True" result="Success" success="True" time="0.052" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECMqvTestVector1" executed="True" result="Success" success="True" time="0.011" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ECTest.TestECMqvTestVector2" executed="True" result="Success" success="True" time="0.017" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ElGamalTest" executed="True" result="Success" success="True" time="0.346" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestEnc1024" executed="True" result="Success" success="True" time="0.084" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestEnc512" executed="True" result="Success" success="True" time="0.022" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestEnc768" executed="True" result="Success" success="True" time="0.070" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestGeneration258" executed="True" result="Success" success="True" time="0.122" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestInitCheck" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ElGamalTest.TestInvalidP" executed="True" result="Success" success="True" time="0.044" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EqualsHashCodeTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.EqualsHashCodeTest.TestDH" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.EqualsHashCodeTest.TestDsa" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.EqualsHashCodeTest.TestElGamal" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.EqualsHashCodeTest.TestGost3410" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GcmReorderTest" executed="True" result="Success" success="True" time="0.029" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmReorderTest.TestCombine" executed="True" result="Success" success="True" time="0.007" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmReorderTest.TestConcatAuth" executed="True" result="Success" success="True" time="0.007" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmReorderTest.TestConcatCrypt" executed="True" result="Success" success="True" time="0.006" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmReorderTest.TestExp" executed="True" result="Success" success="True" time="0.003" asserts="110" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmReorderTest.TestMultiply" executed="True" result="Success" success="True" time="0.003" asserts="51" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GcmTest" executed="True" result="Success" success="True" time="1.190" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.GcmTest.TestFunction" executed="True" result="Success" success="True" time="1.190" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="GMacTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.GMacTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost28147MacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Gost28147MacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost28147Test" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Gost28147Test.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost3410Test" executed="True" result="Success" success="True" time="0.069" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Gost3410Test.TestFunction" executed="True" result="Success" success="True" time="0.068" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost3411DigestTest" executed="True" result="Success" success="True" time="1.203" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Gost3411DigestTest.TestFunction" executed="True" result="Success" success="True" time="1.203" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="HCFamilyVecTest" executed="True" result="Success" success="True" time="0.368" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.HCFamilyVecTest.TestFunction" executed="True" result="Success" success="True" time="0.368" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="IdeaTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.IdeaTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="IsaacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.IsaacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ISO9796Test" executed="True" result="Success" success="True" time="1.225" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoFullMessageTest" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoShortPartialTest" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest1" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest10" executed="True" result="Success" success="True" time="1.089" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest11" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest12" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest13" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest2" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest3" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest4" executed="True" result="Success" success="True" time="0.004" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest5" executed="True" result="Success" success="True" time="0.004" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest6" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest7" executed="True" result="Success" success="True" time="0.014" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest8" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9796Test.DoTest9" executed="True" result="Success" success="True" time="0.014" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ISO9797Alg3MacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ISO9797Alg3MacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Kdf1GeneratorTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Kdf1GeneratorTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Kdf2GeneratorTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Kdf2GeneratorTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.MacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MD2DigestTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.MD2DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MD4DigestTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.MD4DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MD5DigestTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.MD5DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MD5HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.MD5HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Mgf1GeneratorTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Mgf1GeneratorTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ModeTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ModeTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NoekeonTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.NoekeonTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NullTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.NullTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OaepTest" executed="True" result="Success" success="True" time="0.071" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.OaepTest.TestFunction" executed="True" result="Success" success="True" time="0.071" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="OcbTest" executed="True" result="Success" success="True" time="0.251" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.OcbTest.TestFunction" executed="True" result="Success" success="True" time="0.251" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PaddingTest" executed="True" result="Success" success="True" time="0.095" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.PaddingTest.TestFunction" executed="True" result="Success" success="True" time="0.094" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs12Test" executed="True" result="Success" success="True" time="0.022" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Pkcs12Test.TestFunction" executed="True" result="Success" success="True" time="0.022" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs5Test" executed="True" result="Success" success="True" time="0.666" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Pkcs5Test.TestFunction" executed="True" result="Success" success="True" time="0.666" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Poly1305Test" executed="True" result="Success" success="True" time="0.141" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Poly1305Test.TestFunction" executed="True" result="Success" success="True" time="0.141" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PssBlindTest" executed="True" result="Success" success="True" time="7.115" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.PssBlindTest.TestFunction" executed="True" result="Success" success="True" time="7.114" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PssTest" executed="True" result="Success" success="True" time="5.644" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.PssTest.TestFunction" executed="True" result="Success" success="True" time="5.643" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RC2Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RC2Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RC2WrapTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RC2WrapTest.TestFunction" executed="True" result="Success" success="True" time="0.000" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RC4Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RC4Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RC5Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RC5Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RC6Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RC6Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Rfc3211WrapTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Rfc3211WrapTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RijndaelTest" executed="True" result="Success" success="True" time="0.475" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RijndaelTest.TestFunction" executed="True" result="Success" success="True" time="0.475" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD128DigestTest" executed="True" result="Success" success="True" time="0.060" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD128DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.059" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD128HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD128HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD160DigestTest" executed="True" result="Success" success="True" time="0.074" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD160DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.074" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD160HMacTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD160HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD256DigestTest" executed="True" result="Success" success="True" time="0.059" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD256DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.059" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RipeMD320DigestTest" executed="True" result="Success" success="True" time="0.078" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RipeMD320DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.077" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RsaBlindedTest" executed="True" result="Success" success="True" time="0.397" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RsaBlindedTest.TestFunction" executed="True" result="Success" success="True" time="0.397" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="RsaTest" executed="True" result="Success" success="True" time="0.305" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.RsaTest.TestFunction" executed="True" result="Success" success="True" time="0.304" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Salsa20Test" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Salsa20Test.TestFunction" executed="True" result="Success" success="True" time="0.007" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SCryptTest" executed="True" result="Success" success="True" time="1.210" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SCryptTest.TestFunction" executed="True" result="Success" success="True" time="1.210" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SeedTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SeedTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SerpentTest" executed="True" result="Success" success="True" time="0.003" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SerpentTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha1DigestTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha1DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha1HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha1HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha224DigestTest" executed="True" result="Success" success="True" time="0.063" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha224DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.063" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha224HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha224HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha256DigestTest" executed="True" result="Success" success="True" time="0.059" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha256DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.058" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha256HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha256HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha384DigestTest" executed="True" result="Success" success="True" time="0.045" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha384DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.045" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha384HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha384HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha3DigestTest" executed="True" result="Success" success="True" time="0.616" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha3DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.616" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha512DigestTest" executed="True" result="Success" success="True" time="0.046" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha512DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.046" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Sha512HMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Sha512HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ShortenedDigestTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.ShortenedDigestTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SipHashTest" executed="True" result="Success" success="True" time="0.016" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SipHashTest.TestFunction" executed="True" result="Success" success="True" time="0.015" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SkeinDigestTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SkeinDigestTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SkeinMacTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SkeinMacTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SkipjackTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SkipjackTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SM3DigestTest" executed="True" result="Success" success="True" time="0.089" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.SM3DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.088" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Srp6Test" executed="True" result="Success" success="True" time="0.846" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Srp6Test.TestFunction" executed="True" result="Success" success="True" time="0.845" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TeaTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.TeaTest.TestFunction" executed="True" result="Success" success="True" time="0.000" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Threefish1024Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Threefish1024Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Threefish256Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Threefish256Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Threefish512Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.Threefish512Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TigerDigestTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.TigerDigestTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TwofishTest" executed="True" result="Success" success="True" time="0.002" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.TwofishTest.TestFunction" executed="True" result="Success" success="True" time="0.002" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="VmpcKsa3Test" executed="True" result="Success" success="True" time="0.163" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.VmpcKsa3Test.TestFunction" executed="True" result="Success" success="True" time="0.162" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="VmpcMacTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.VmpcMacTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="VmpcTest" executed="True" result="Success" success="True" time="0.168" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.VmpcTest.TestFunction" executed="True" result="Success" success="True" time="0.168" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="WhirlpoolDigestTest" executed="True" result="Success" success="True" time="0.664" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.WhirlpoolDigestTest.TestFunction" executed="True" result="Success" success="True" time="0.664" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X931SignerTest" executed="True" result="Success" success="True" time="0.028" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.X931SignerTest.TestFunction" executed="True" result="Success" success="True" time="0.027" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="XSalsa20Test" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.XSalsa20Test.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="XteaTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tests.XteaTest.TestFunction" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tls" executed="True" result="Success" success="True" time="2.627" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="2.627" asserts="0"> + <results> + <test-suite type="TestFixture" name="TlsProtocolTest" executed="True" result="Success" success="True" time="0.292" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsProtocolTest.TestClientServer" executed="True" result="Success" success="True" time="0.292" asserts="2" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TlsPskProtocolTest" executed="True" result="Success" success="True" time="0.031" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsPskProtocolTest.TestClientServer" executed="True" result="Success" success="True" time="0.031" asserts="2" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TlsSrpProtocolTest" executed="True" result="Success" success="True" time="0.136" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsSrpProtocolTest.TestClientServer" executed="True" result="Success" success="True" time="0.136" asserts="2" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TlsTestCase" executed="True" result="Success" success="True" time="2.164" asserts="0"> + <results> + <test-suite type="ParameterizedTest" name="RunTest" executed="True" result="Success" success="True" time="2.162" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.FallbackGood" executed="True" result="Success" success="True" time="0.147" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.FallbackBad" executed="True" result="Success" success="True" time="0.002" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.FallbackNone" executed="True" result="Success" success="True" time="0.141" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_GoodDefault" executed="True" result="Success" success="True" time="0.135" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_BadCertificateVerify" executed="True" result="Success" success="True" time="0.135" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_BadClientCertificate" executed="True" result="Success" success="True" time="0.132" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_BadMandatoryCertReqDeclined" executed="True" result="Success" success="True" time="0.072" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_GoodNoCertReq" executed="True" result="Success" success="True" time="0.071" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS10_GoodOptionalCertReqDeclined" executed="True" result="Success" success="True" time="0.072" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_GoodDefault" executed="True" result="Success" success="True" time="0.137" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_BadCertificateVerify" executed="True" result="Success" success="True" time="0.136" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_BadClientCertificate" executed="True" result="Success" success="True" time="0.134" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_BadMandatoryCertReqDeclined" executed="True" result="Success" success="True" time="0.084" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_GoodNoCertReq" executed="True" result="Success" success="True" time="0.072" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS11_GoodOptionalCertReqDeclined" executed="True" result="Success" success="True" time="0.072" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_GoodDefault" executed="True" result="Success" success="True" time="0.135" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_BadCertificateVerify" executed="True" result="Success" success="True" time="0.135" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_BadClientCertificate" executed="True" result="Success" success="True" time="0.132" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_BadMandatoryCertReqDeclined" executed="True" result="Success" success="True" time="0.068" asserts="6" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_GoodNoCertReq" executed="True" result="Success" success="True" time="0.072" asserts="10" /> + <test-case name="Org.BouncyCastle.Crypto.Tls.Tests.TlsTestCase.TLS12_GoodOptionalCertReqDeclined" executed="True" result="Success" success="True" time="0.071" asserts="10" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Math" executed="True" result="Success" success="True" time="226.600" asserts="0"> + <results> + <test-suite type="Namespace" name="EC" executed="True" result="Success" success="True" time="226.338" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="226.338" asserts="0"> + <results> + <test-suite type="TestFixture" name="ECAlgorithmsTest" executed="True" result="Success" success="True" time="193.009" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECAlgorithmsTest.TestSumOfMultiplies" executed="True" result="Success" success="True" time="68.492" asserts="1500" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECAlgorithmsTest.TestSumOfTwoMultiplies" executed="True" result="Success" success="True" time="124.515" asserts="3000" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECPointTest" executed="True" result="Success" success="True" time="33.328" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestAdd" executed="True" result="Success" success="True" time="0.005" asserts="20" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestAddSubtractMultiplySimple" executed="True" result="Success" success="True" time="0.035" asserts="832" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestAddSubtractMultiplyTwiceEncoding" executed="True" result="Success" success="True" time="33.268" asserts="13680" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestAllPoints" executed="True" result="Success" success="True" time="0.011" asserts="236" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestPointCreationConsistency" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestThreeTimes" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Math.EC.Tests.ECPointTest.TestTwice" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.259" asserts="0"> + <results> + <test-suite type="TestFixture" name="BigIntegerTest" executed="True" result="Success" success="True" time="0.258" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.MonoBug81857" executed="True" result="Success" success="True" time="0.000" asserts="1" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestAbs" executed="True" result="Success" success="True" time="0.001" asserts="5" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestAdd" executed="True" result="Success" success="True" time="0.002" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestAnd" executed="True" result="Success" success="True" time="0.003" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestAndNot" executed="True" result="Success" success="True" time="0.003" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestBitCount" executed="True" result="Success" success="True" time="0.002" asserts="215" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestBitLength" executed="True" result="Success" success="True" time="0.002" asserts="405" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestClearBit" executed="True" result="Success" success="True" time="0.008" asserts="2306" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestCompareTo" executed="True" result="Success" success="True" time="0.002" asserts="25" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestConstructors" executed="True" result="Success" success="True" time="0.001" asserts="12" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestDivide" executed="True" result="Success" success="True" time="0.005" asserts="485" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestDivideAndRemainder" executed="True" result="Success" success="True" time="0.005" asserts="824" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestFlipBit" executed="True" result="Success" success="True" time="0.006" asserts="2210" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestGcd" executed="True" result="Success" success="True" time="0.015" asserts="10" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestGetLowestSetBit" executed="True" result="Success" success="True" time="0.001" asserts="300" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestIntValue" executed="True" result="Success" success="True" time="0.001" asserts="10" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestIsProbablePrime" executed="True" result="Success" success="True" time="0.005" asserts="89" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestLongValue" executed="True" result="Success" success="True" time="0.000" asserts="10" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestMax" executed="True" result="Success" success="True" time="0.001" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestMin" executed="True" result="Success" success="True" time="0.001" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestMod" executed="True" result="Success" success="True" time="0.002" asserts="200" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestModInverse" executed="True" result="Success" success="True" time="0.010" asserts="148" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestModPow" executed="True" result="Success" success="True" time="0.099" asserts="504" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestMultiply" executed="True" result="Success" success="True" time="0.003" asserts="1001" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestNegate" executed="True" result="Success" success="True" time="0.000" asserts="21" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestNextProbablePrime" executed="True" result="Success" success="True" time="0.001" asserts="33" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestNot" executed="True" result="Success" success="True" time="0.001" asserts="21" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestOr" executed="True" result="Success" success="True" time="0.002" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestPow" executed="True" result="Success" success="True" time="0.002" asserts="16" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestRemainder" executed="True" result="Success" success="True" time="0.001" asserts="10" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestSetBit" executed="True" result="Success" success="True" time="0.004" asserts="2306" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestShiftLeft" executed="True" result="Success" success="True" time="0.009" asserts="23475" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestShiftRight" executed="True" result="Success" success="True" time="0.001" asserts="1935" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestSignValue" executed="True" result="Success" success="True" time="0.001" asserts="21" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestSubtract" executed="True" result="Success" success="True" time="0.002" asserts="441" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestTestBit" executed="True" result="Success" success="True" time="0.001" asserts="120" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestToByteArray" executed="True" result="Success" success="True" time="0.010" asserts="133" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestToByteArrayUnsigned" executed="True" result="Success" success="True" time="0.009" asserts="133" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestToString" executed="True" result="Success" success="True" time="0.017" asserts="1327" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestValueOf" executed="True" result="Success" success="True" time="0.001" asserts="13" /> + <test-case name="Org.BouncyCastle.Math.Tests.BigIntegerTest.TestXor" executed="True" result="Success" success="True" time="0.002" asserts="441" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Ocsp" executed="True" result="Success" success="True" time="0.344" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.344" asserts="0"> + <results> + <test-suite type="TestFixture" name="OcspTest" executed="True" result="Success" success="True" time="0.343" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Ocsp.Tests.OcspTest.TestFunction" executed="True" result="Success" success="True" time="0.342" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="OpenSsl" executed="True" result="Success" success="True" time="2.856" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="2.856" asserts="0"> + <results> + <test-suite type="TestFixture" name="AllTests" executed="True" result="Success" success="True" time="1.867" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.OpenSsl.Tests.AllTests.TestOpenSsl" executed="True" result="Success" success="True" time="0.968" asserts="0" /> + <test-case name="Org.BouncyCastle.OpenSsl.Tests.AllTests.TestPkcs8Encrypted" executed="True" result="Success" success="True" time="0.265" asserts="1" /> + <test-case name="Org.BouncyCastle.OpenSsl.Tests.AllTests.TestPkcs8Plain" executed="True" result="Success" success="True" time="0.633" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ReaderTest" executed="True" result="Success" success="True" time="0.252" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.OpenSsl.Tests.ReaderTest.TestFunction" executed="True" result="Success" success="True" time="0.252" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="WriterTest" executed="True" result="Success" success="True" time="0.734" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.OpenSsl.Tests.WriterTest.TestFunction" executed="True" result="Success" success="True" time="0.734" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Pkcs" executed="True" result="Success" success="True" time="1.149" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="1.149" asserts="0"> + <results> + <test-suite type="TestFixture" name="EncryptedPrivateKeyInfoTest" executed="True" result="Success" success="True" time="0.856" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Pkcs.Tests.EncryptedPrivateKeyInfoTest.TestFunction" executed="True" result="Success" success="True" time="0.855" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs10Test" executed="True" result="Success" success="True" time="0.020" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Pkcs.Tests.Pkcs10Test.TestFunction" executed="True" result="Success" success="True" time="0.019" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs12StoreTest" executed="True" result="Success" success="True" time="0.270" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Pkcs.Tests.Pkcs12StoreTest.TestFunction" executed="True" result="Success" success="True" time="0.269" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Security" executed="True" result="Success" success="True" time="66.270" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="66.270" asserts="0"> + <results> + <test-suite type="TestFixture" name="SecureRandomTest" executed="True" result="Success" success="True" time="63.605" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestCryptoApi" executed="True" result="Success" success="True" time="1.481" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestDefault" executed="True" result="Success" success="True" time="16.054" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestSha1Prng" executed="True" result="Success" success="True" time="13.069" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestSha1PrngBackward" executed="True" result="Success" success="True" time="0.001" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestSha256Prng" executed="True" result="Success" success="True" time="15.997" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestThreadedSeed" executed="True" result="Success" success="True" time="13.281" asserts="1" /> + <test-case name="Org.BouncyCastle.Security.Tests.SecureRandomTest.TestVmpcPrng" executed="True" result="Success" success="True" time="3.718" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TestDigestUtilities" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.TestDigestUtilities.TestAlgorithms" executed="True" result="Success" success="True" time="0.006" asserts="15" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TestDotNetUtilities" executed="True" result="Success" success="True" time="1.636" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.TestDotNetUtilities.TestRsaInterop" executed="True" result="Success" success="True" time="1.628" asserts="0" /> + <test-case name="Org.BouncyCastle.Security.Tests.TestDotNetUtilities.TestX509CertificateConversion" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TestEncodings" executed="True" result="Success" success="True" time="0.017" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.TestEncodings.TestDH" executed="True" result="Success" success="True" time="0.004" asserts="3" /> + <test-case name="Org.BouncyCastle.Security.Tests.TestEncodings.TestDSA" executed="True" result="Success" success="True" time="0.001" asserts="3" /> + <test-case name="Org.BouncyCastle.Security.Tests.TestEncodings.TestEC" executed="True" result="Success" success="True" time="0.003" asserts="2" /> + <test-case name="Org.BouncyCastle.Security.Tests.TestEncodings.TestElGamal" executed="True" result="Success" success="True" time="0.003" asserts="3" /> + <test-case name="Org.BouncyCastle.Security.Tests.TestEncodings.TestRsa" executed="True" result="Success" success="True" time="0.002" asserts="3" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TestParameterUtilities" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.TestParameterUtilities.TestCreateKeyParameter" executed="True" result="Success" success="True" time="0.004" asserts="32" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TestSignerUtilities" executed="True" result="Success" success="True" time="0.995" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Security.Tests.TestSignerUtilities.TestAlgorithms" executed="True" result="Success" success="True" time="0.994" asserts="25" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="16.340" asserts="0"> + <results> + <test-suite type="TestFixture" name="AesSicTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.AesSicTest.TestFunction" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AesTest" executed="True" result="Success" success="True" time="0.019" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestCcm" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestCiphers" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestEax" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestGcm" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestOids" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestWrap" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.AesTest.TestWrapOids" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AttrCertSelectorTest" executed="True" result="Success" success="True" time="0.025" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.AttrCertSelectorTest.TestSelector" executed="True" result="Success" success="True" time="0.024" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="AttrCertTest" executed="True" result="Success" success="True" time="0.033" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.AttrCertTest.TestFunction" executed="True" result="Success" success="True" time="0.032" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="BlockCipherTest" executed="True" result="Success" success="True" time="0.039" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.BlockCipherTest.TestFunction" executed="True" result="Success" success="True" time="0.034" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CamelliaTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CamelliaTest.TestCiphers" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CamelliaTest.TestOids" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CamelliaTest.TestWrap" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CamelliaTest.TestWrapOids" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertPathBuilderTest" executed="True" result="Success" success="True" time="1.288" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CertPathBuilderTest.TestFunction" executed="True" result="Success" success="True" time="1.288" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertPathTest" executed="True" result="Success" success="True" time="0.014" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CertPathTest.TestFunction" executed="True" result="Success" success="True" time="0.013" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertPathValidatorTest" executed="True" result="Success" success="True" time="0.023" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CertPathValidatorTest.TestFunction" executed="True" result="Success" success="True" time="0.022" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CertTest" executed="True" result="Success" success="True" time="1.515" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CertTest.TestFunction" executed="True" result="Success" success="True" time="1.513" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CipherStreamTest" executed="True" result="Success" success="True" time="0.028" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestDesCfbNoPadding" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestDesEcbPkcs7" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC128" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC128Algorithm" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC128Exception" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC256" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC256Algorithm" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestHC256Exception" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestRC4" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestRC4Algorithm" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestRC4Exception" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestSalsa20" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestSalsa20Algorithm" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestSalsa20Exception" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestVmpc" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestVmpcException" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestVmpcKsa3" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.CipherStreamTest.TestVmpcKsa3Exception" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="CMacTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.CMacTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Crl5Test" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Crl5Test.TestDirectCrl" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Crl5Test.TestIndirectCrl" executed="True" result="Success" success="True" time="0.004" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DesEdeTest" executed="True" result="Success" success="True" time="0.010" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.DesEdeTest.TestFunction" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DHTest" executed="True" result="Success" success="True" time="0.471" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.DHTest.TestECDH" executed="True" result="Success" success="True" time="0.045" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DHTest.TestECDHC" executed="True" result="Success" success="True" time="0.041" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DHTest.TestEnc" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DHTest.TestExceptions" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DHTest.TestFunction" executed="True" result="Success" success="True" time="0.378" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DigestTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.DigestTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="DsaTest" executed="True" result="Success" success="True" time="4.851" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestDsa2Parameters" executed="True" result="Success" success="True" time="4.330" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinary" executed="True" result="Success" success="True" time="0.022" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinaryRipeMD160" executed="True" result="Success" success="True" time="0.022" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinarySha1" executed="True" result="Success" success="True" time="0.021" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinarySha224" executed="True" result="Success" success="True" time="0.020" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinarySha256" executed="True" result="Success" success="True" time="0.021" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinarySha384" executed="True" result="Success" success="True" time="0.021" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitBinarySha512" executed="True" result="Success" success="True" time="0.020" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestECDsa239BitPrime" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestGeneration" executed="True" result="Success" success="True" time="0.172" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestNONEwithDSA" executed="True" result="Success" success="True" time="0.116" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.DsaTest.TestParameters" executed="True" result="Success" success="True" time="0.050" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECDsa5Test" executed="True" result="Success" success="True" time="0.088" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.ECDsa5Test.DecodeTest" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ECDsa5Test.TestECDsa239BitBinary" executed="True" result="Success" success="True" time="0.023" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ECDsa5Test.TestECDsa239BitPrime" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ECDsa5Test.TestGeneration" executed="True" result="Success" success="True" time="0.033" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECEncodingTest" executed="True" result="Success" success="True" time="0.121" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.ECEncodingTest.TestFunction" executed="True" result="Success" success="True" time="0.120" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ECNRTest" executed="True" result="Success" success="True" time="0.078" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.ECNRTest.TestECNR192bitPrime" executed="True" result="Success" success="True" time="0.017" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ECNRTest.TestECNR239bitPrime" executed="True" result="Success" success="True" time="0.020" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ECNRTest.TestECNR521bitPrime" executed="True" result="Success" success="True" time="0.040" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ElGamalTest" executed="True" result="Success" success="True" time="0.672" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.ElGamalTest.TestGP1024" executed="True" result="Success" success="True" time="0.330" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ElGamalTest.TestGP512" executed="True" result="Success" success="True" time="0.047" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ElGamalTest.TestGP768" executed="True" result="Success" success="True" time="0.146" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.ElGamalTest.TestRandom256" executed="True" result="Success" success="True" time="0.147" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="EncryptedPrivateKeyInfoTest" executed="True" result="Success" success="True" time="0.045" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.EncryptedPrivateKeyInfoTest.TestFunction" executed="True" result="Success" success="True" time="0.044" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="FipsDesTest" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.FipsDesTest.TestFunction" executed="True" result="Success" success="True" time="0.006" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost28147Test" executed="True" result="Success" success="True" time="0.006" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Gost28147Test.TestFunction" executed="True" result="Success" success="True" time="0.005" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Gost3410Test" executed="True" result="Success" success="True" time="0.147" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Gost3410Test.TestFunction" executed="True" result="Success" success="True" time="0.147" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="HMacTest" executed="True" result="Success" success="True" time="0.007" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.HMacTest.TestFunction" executed="True" result="Success" success="True" time="0.006" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="IesTest" executed="True" result="Success" success="True" time="0.041" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.IesTest.TestFunction" executed="True" result="Success" success="True" time="0.040" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MacTest" executed="True" result="Success" success="True" time="0.005" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.MacTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="MqvTest" executed="True" result="Success" success="True" time="0.055" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.MqvTest.TestECMqv" executed="True" result="Success" success="True" time="0.055" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NamedCurveTest" executed="True" result="Success" success="True" time="2.588" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.NamedCurveTest.TestFunction" executed="True" result="Success" success="True" time="2.587" asserts="1" /> + </results> + </test-suite> + <test-suite type="Namespace" name="Nist" executed="True" result="Success" success="True" time="0.463" asserts="0"> + <results> + <test-suite type="TestFixture" name="NistCertPathTest" executed="True" result="Success" success="True" time="0.462" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAllCertificatesAnyPolicyTest11" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAllCertificatesNoPoliciesTest2" executed="True" result="Success" success="True" time="0.009" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAllCertificatesSamePoliciesTest10" executed="True" result="Success" success="True" time="0.016" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAllCertificatesSamePoliciesTest13" executed="True" result="Success" success="True" time="0.016" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAllCertificatesSamePolicyTest1" executed="True" result="Success" success="True" time="0.020" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestAnyPolicyTest14" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestCANotBeforeDateTest1" executed="True" result="Success" success="True" time="0.004" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest12" executed="True" result="Success" success="True" time="0.005" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest3" executed="True" result="Success" success="True" time="0.018" asserts="4" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest4" executed="True" result="Success" success="True" time="0.007" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest5" executed="True" result="Success" success="True" time="0.008" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest7" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest8" executed="True" result="Success" success="True" time="0.008" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestDifferentPoliciesTest9" executed="True" result="Success" success="True" time="0.009" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidCANotAfterDateTest5" executed="True" result="Success" success="True" time="0.003" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidCASignatureTest2" executed="True" result="Success" success="True" time="0.003" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvaliddistributionPointTest3" executed="True" result="Success" success="True" time="0.007" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvaliddistributionPointTest8" executed="True" result="Success" success="True" time="0.007" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvaliddistributionPointTest9" executed="True" result="Success" success="True" time="0.005" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidDSASignaturesTest6" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidEENotAfterDateTest6" executed="True" result="Success" success="True" time="0.004" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidEENotBeforeDateTest2" executed="True" result="Success" success="True" time="0.004" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidEESignatureTest3" executed="True" result="Success" success="True" time="0.004" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidInhibitPolicyMappingTest1" executed="True" result="Success" success="True" time="0.008" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidNegativeSerialNumberTest15" executed="True" result="Success" success="True" time="0.006" asserts="3" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidonlySomeReasonsTest17" executed="True" result="Success" success="True" time="0.007" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidUnknownCRLExtensionTest10" executed="True" result="Success" success="True" time="0.006" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestInvalidValidPre2000UTCNotAfterDateTest7" executed="True" result="Success" success="True" time="0.005" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestOverlappingPoliciesTest6" executed="True" result="Success" success="True" time="0.026" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestUserNoticeQualifierTest15" executed="True" result="Success" success="True" time="0.009" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestUserNoticeQualifierTest16" executed="True" result="Success" success="True" time="0.015" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestUserNoticeQualifierTest17" executed="True" result="Success" success="True" time="0.014" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestUserNoticeQualifierTest18" executed="True" result="Success" success="True" time="0.011" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestUserNoticeQualifierTest19" executed="True" result="Success" success="True" time="0.007" asserts="2" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValiddistributionPointTest5" executed="True" result="Success" success="True" time="0.006" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidDSAParameterInheritanceTest5" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidDSASignaturesTest4" executed="True" result="Success" success="True" time="0.016" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidGeneralizedTimeNotBeforeDateTest4" executed="True" result="Success" success="True" time="0.005" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidInhibitPolicyMappingTest2" executed="True" result="Success" success="True" time="0.008" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidpathLenConstraintTest13" executed="True" result="Success" success="True" time="0.011" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidPre2000UTCNotBeforeDateTest3" executed="True" result="Success" success="True" time="0.005" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidSelfIssuedInhibitAnyPolicyTest7" executed="True" result="Success" success="True" time="0.022" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidSeparateCertificateandCRLKeysTest19" executed="True" result="Success" success="True" time="0.015" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.Nist.NistCertPathTest.TestValidSignaturesTest1" executed="True" result="Success" success="True" time="0.005" asserts="0" /> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="TestFixture" name="NistCertPathTest" executed="True" result="Success" success="True" time="0.867" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.NistCertPathTest.TestFunction" executed="True" result="Success" success="True" time="0.856" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="NoekeonTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.NoekeonTest.TestFunction" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PbeTest" executed="True" result="Success" success="True" time="0.066" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.PbeTest.TestFunction" executed="True" result="Success" success="True" time="0.064" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="Pkcs10CertRequestTest" executed="True" result="Success" success="True" time="1.623" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Pkcs10CertRequestTest.TestFunction" executed="True" result="Success" success="True" time="1.622" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PkixNameConstraintsTest" executed="True" result="Success" success="True" time="0.040" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.PkixNameConstraintsTest.TestFunction" executed="True" result="Success" success="True" time="0.035" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PkixPolicyMappingTest" executed="True" result="Success" success="True" time="0.176" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.PkixPolicyMappingTest.TestFunction" executed="True" result="Success" success="True" time="0.175" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PkixTest" executed="True" result="Success" success="True" time="0.022" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.PkixTest.TestFunction" executed="True" result="Success" success="True" time="0.021" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="PssTest" executed="True" result="Success" success="True" time="0.106" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.PssTest.TestFunction" executed="True" result="Success" success="True" time="0.105" asserts="1" /> + </results> + </test-suite> + <test-suite type="Namespace" name="Rsa3" executed="True" result="Success" success="True" time="0.044" asserts="0"> + <results> + <test-suite type="TestFixture" name="RSA3CertTest" executed="True" result="Success" success="True" time="0.044" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestA" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestB" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestC" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestD" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestE" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestF" executed="True" result="Success" success="True" time="0.004" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestG" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestH" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestI" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestJ" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + <test-case name="Org.BouncyCastle.Tests.Rsa3.RSA3CertTest.TestL" executed="True" result="Success" success="True" time="0.003" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="TestFixture" name="RsaTest" executed="True" result="Success" success="True" time="0.483" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.RsaTest.TestFunction" executed="True" result="Success" success="True" time="0.481" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SeedTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.SeedTest.TestCiphers" executed="True" result="Success" success="True" time="0.003" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.SeedTest.TestOids" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.SeedTest.TestWrap" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + <test-case name="Org.BouncyCastle.Tests.SeedTest.TestWrapOids" executed="True" result="Success" success="True" time="0.000" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="SigTest" executed="True" result="Success" success="True" time="0.136" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.SigTest.TestFunction" executed="True" result="Success" success="True" time="0.135" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="WrapTest" executed="True" result="Success" success="True" time="0.028" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.WrapTest.TestFunction" executed="True" result="Success" success="True" time="0.028" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X509CertificatePairTest" executed="True" result="Success" success="True" time="0.008" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.X509CertificatePairTest.TestFunction" executed="True" result="Success" success="True" time="0.008" asserts="1" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="X509StoreTest" executed="True" result="Success" success="True" time="0.013" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tests.X509StoreTest.TestFunction" executed="True" result="Success" success="True" time="0.012" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Tsp" executed="True" result="Success" success="True" time="0.421" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.421" asserts="0"> + <results> + <test-suite type="TestFixture" name="GenTimeAccuracyUnitTest" executed="True" result="Success" success="True" time="0.014" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestNullNullNull" executed="True" result="Success" success="True" time="0.004" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestOneNullOne" executed="True" result="Success" success="True" time="0.000" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestOneTwoThree" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestThreeTwoNull" executed="True" result="Success" success="True" time="0.000" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestThreeTwoOne" executed="True" result="Success" success="True" time="0.000" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestTwoThreeTwo" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestZeroNullNull" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.GenTimeAccuracyUnitTest.TestZeroTwoThree" executed="True" result="Success" success="True" time="0.001" asserts="4" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="ParseTest" executed="True" result="Success" success="True" time="0.051" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestGeneralizedTime" executed="True" result="Success" success="True" time="0.014" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestMD5" executed="True" result="Success" success="True" time="0.020" asserts="3" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestRipeMD160" executed="True" result="Success" success="True" time="0.001" asserts="3" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestSha1" executed="True" result="Success" success="True" time="0.003" asserts="6" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestUnacceptable" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.ParseTest.TestV2SigningResponseParse" executed="True" result="Success" success="True" time="0.007" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TimeStampTokenInfoUnitTest" executed="True" result="Success" success="True" time="0.010" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tsp.Tests.TimeStampTokenInfoUnitTest.TestTstInfo1" executed="True" result="Success" success="True" time="0.004" asserts="9" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TimeStampTokenInfoUnitTest.TestTstInfo2" executed="True" result="Success" success="True" time="0.002" asserts="10" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TimeStampTokenInfoUnitTest.TestTstInfo3" executed="True" result="Success" success="True" time="0.001" asserts="11" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TimeStampTokenInfoUnitTest.TestTstInfoDudDate" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + </results> + </test-suite> + <test-suite type="TestFixture" name="TspTest" executed="True" result="Success" success="True" time="0.344" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestAccuracyWithCertsAndOrdering" executed="True" result="Success" success="True" time="0.023" asserts="9" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestAccuracyZeroCerts" executed="True" result="Success" success="True" time="0.010" asserts="6" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestBadAlgorithm" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestBadPolicy" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestBasic" executed="True" result="Success" success="True" time="0.010" asserts="1" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestCertReq" executed="True" result="Success" success="True" time="0.010" asserts="2" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestIncorrectHash" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestNoNonce" executed="True" result="Success" success="True" time="0.009" asserts="7" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestResponseValidation" executed="True" result="Success" success="True" time="0.011" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestTimeNotAvailable" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Tsp.Tests.TspTest.TestTokenEncoding" executed="True" result="Success" success="True" time="0.009" asserts="0" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Utilities" executed="True" result="Success" success="True" time="0.011" asserts="0"> + <results> + <test-suite type="Namespace" name="IO" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-suite type="Namespace" name="Pem" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-suite type="TestFixture" name="AllTests" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Utilities.IO.Pem.Tests.AllTests.TestPemLength" executed="True" result="Success" success="True" time="0.003" asserts="68" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="Net" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-suite type="TestFixture" name="IPTest" executed="True" result="Success" success="True" time="0.004" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.Utilities.Net.Tests.IPTest.TestIPv4" executed="True" result="Success" success="True" time="0.002" asserts="0" /> + <test-case name="Org.BouncyCastle.Utilities.Net.Tests.IPTest.TestIPv6" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + <test-suite type="Namespace" name="X509" executed="True" result="Success" success="True" time="0.061" asserts="0"> + <results> + <test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.061" asserts="0"> + <results> + <test-suite type="TestFixture" name="TestCertificateGen" executed="True" result="Success" success="True" time="0.060" asserts="0"> + <results> + <test-case name="Org.BouncyCastle.X509.Tests.TestCertificateGen.TestCertLoading" executed="True" result="Success" success="True" time="0.004" asserts="12" /> + <test-case name="Org.BouncyCastle.X509.Tests.TestCertificateGen.TestCreationDSA" executed="True" result="Success" success="True" time="0.005" asserts="0" /> + <test-case name="Org.BouncyCastle.X509.Tests.TestCertificateGen.TestCreationECDSA" executed="True" result="Success" success="True" time="0.030" asserts="0" /> + <test-case name="Org.BouncyCastle.X509.Tests.TestCertificateGen.TestCreationRSA" executed="True" result="Success" success="True" time="0.010" asserts="0" /> + <test-case name="Org.BouncyCastle.X509.Tests.TestCertificateGen.TestRsaDigestSigner" executed="True" result="Success" success="True" time="0.009" asserts="1" /> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> + </results> + </test-suite> +</test-results> \ No newline at end of file diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index 35474aebb..50daeec48 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -539,6 +539,16 @@ BuildAction = "Compile" /> <File + RelPath = "src\asn1\anssi\ANSSINamedCurves.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\asn1\anssi\ANSSIObjectIdentifiers.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "src\asn1\bc\BCObjectIdentifiers.cs" SubType = "Code" BuildAction = "Compile" @@ -5119,16 +5129,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\math\ec\Mod.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\Nat.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\ScaleXPointMap.cs" SubType = "Code" BuildAction = "Compile" @@ -5174,31 +5174,6 @@ BuildAction = "Compile" /> <File - RelPath = "src\math\ec\custom\sec\Nat192.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\custom\sec\Nat224.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\custom\sec\Nat256.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\custom\sec\Nat384.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "src\math\ec\custom\sec\Nat512.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "src\math\ec\custom\sec\SecP192K1Curve.cs" SubType = "Code" BuildAction = "Compile" @@ -5519,6 +5494,71 @@ BuildAction = "Compile" /> <File + RelPath = "src\math\raw\Interleave.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Mod.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat128.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat160.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat192.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat224.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat256.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat320.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat384.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat448.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat512.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "src\math\raw\Nat576.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "src\ocsp\BasicOCSPResp.cs" SubType = "Code" BuildAction = "Compile" diff --git a/crypto/src/asn1/anssi/ANSSINamedCurves.cs b/crypto/src/asn1/anssi/ANSSINamedCurves.cs new file mode 100644 index 000000000..04e30bb07 --- /dev/null +++ b/crypto/src/asn1/anssi/ANSSINamedCurves.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections; + +using Org.BouncyCastle.Asn1.X9; +using Org.BouncyCastle.Math; +using Org.BouncyCastle.Math.EC; +using Org.BouncyCastle.Utilities; +using Org.BouncyCastle.Utilities.Collections; +using Org.BouncyCastle.Utilities.Encoders; + +namespace 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)); + ECPoint G = curve.DecodePoint(Hex.Decode("04" + + "B6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF" + + "6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB")); + + return new X9ECParameters(curve, G, n, h, S); + } + }; + + + private static readonly IDictionary objIds = Platform.CreateHashtable(); + private static readonly IDictionary curves = Platform.CreateHashtable(); + private static readonly IDictionary names = Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(Platform.ToLowerInvariant(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[Platform.ToLowerInvariant(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); } + } + } +} diff --git a/crypto/src/asn1/anssi/ANSSIObjectIdentifiers.cs b/crypto/src/asn1/anssi/ANSSIObjectIdentifiers.cs new file mode 100644 index 000000000..d230832b5 --- /dev/null +++ b/crypto/src/asn1/anssi/ANSSIObjectIdentifiers.cs @@ -0,0 +1,13 @@ +using System; + +namespace 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"); + } +} diff --git a/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs b/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs index ca57c283d..32d3103af 100644 --- a/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs +++ b/crypto/src/asn1/cryptopro/ECGOST3410NamedCurves.cs @@ -150,7 +150,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro */ public static IEnumerable Names { - get { return new EnumerableProxy(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } public static ECDomainParameters GetByName( diff --git a/crypto/src/asn1/nist/NISTNamedCurves.cs b/crypto/src/asn1/nist/NISTNamedCurves.cs index 0e82dda7a..f6c1598c6 100644 --- a/crypto/src/asn1/nist/NISTNamedCurves.cs +++ b/crypto/src/asn1/nist/NISTNamedCurves.cs @@ -21,45 +21,40 @@ namespace Org.BouncyCastle.Asn1.Nist private static readonly IDictionary objIds = Platform.CreateHashtable(); private static readonly IDictionary names = Platform.CreateHashtable(); - private static void DefineCurve( + private static void DefineCurveAlias( string name, DerObjectIdentifier oid) { - objIds.Add(name, oid); + objIds.Add(Platform.ToUpperInvariant(name), oid); names.Add(oid, name); } static NistNamedCurves() { - DefineCurve("B-571", SecObjectIdentifiers.SecT571r1); - DefineCurve("B-409", SecObjectIdentifiers.SecT409r1); - DefineCurve("B-283", SecObjectIdentifiers.SecT283r1); - DefineCurve("B-233", SecObjectIdentifiers.SecT233r1); - DefineCurve("B-163", SecObjectIdentifiers.SecT163r2); - DefineCurve("K-571", SecObjectIdentifiers.SecT571k1); - DefineCurve("K-409", SecObjectIdentifiers.SecT409k1); - DefineCurve("K-283", SecObjectIdentifiers.SecT283k1); - DefineCurve("K-233", SecObjectIdentifiers.SecT233k1); - DefineCurve("K-163", SecObjectIdentifiers.SecT163k1); - DefineCurve("P-521", SecObjectIdentifiers.SecP521r1); - DefineCurve("P-384", SecObjectIdentifiers.SecP384r1); - DefineCurve("P-256", SecObjectIdentifiers.SecP256r1); - DefineCurve("P-224", SecObjectIdentifiers.SecP224r1); - DefineCurve("P-192", SecObjectIdentifiers.SecP192r1); + 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 = (DerObjectIdentifier) objIds[ - Platform.ToUpperInvariant(name)]; - - if (oid != null) - { - return GetByOid(oid); - } - - return null; + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); } /** @@ -83,8 +78,7 @@ namespace Org.BouncyCastle.Asn1.Nist public static DerObjectIdentifier GetOid( string name) { - return (DerObjectIdentifier) objIds[ - Platform.ToUpperInvariant(name)]; + return (DerObjectIdentifier) objIds[Platform.ToUpperInvariant(name)]; } /** @@ -102,7 +96,7 @@ namespace Org.BouncyCastle.Asn1.Nist */ public static IEnumerable Names { - get { return new EnumerableProxy(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } } } diff --git a/crypto/src/asn1/sec/SECNamedCurves.cs b/crypto/src/asn1/sec/SECNamedCurves.cs index 60d456ef0..0bd60b0b8 100644 --- a/crypto/src/asn1/sec/SECNamedCurves.cs +++ b/crypto/src/asn1/sec/SECNamedCurves.cs @@ -1154,7 +1154,7 @@ namespace Org.BouncyCastle.Asn1.Sec DerObjectIdentifier oid, X9ECParametersHolder holder) { - objIds.Add(name, oid); + objIds.Add(Platform.ToLowerInvariant(name), oid); names.Add(oid, name); curves.Add(oid, holder); } @@ -1200,9 +1200,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static X9ECParameters GetByName( string name) { - DerObjectIdentifier oid = (DerObjectIdentifier) - objIds[Platform.ToLowerInvariant(name)]; - + DerObjectIdentifier oid = GetOid(name); return oid == null ? null : GetByOid(oid); } @@ -1215,8 +1213,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static X9ECParameters GetByOid( DerObjectIdentifier oid) { - X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid]; - + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; return holder == null ? null : holder.Parameters; } @@ -1238,7 +1235,7 @@ namespace Org.BouncyCastle.Asn1.Sec public static string GetName( DerObjectIdentifier oid) { - return (string) names[oid]; + return (string)names[oid]; } /** @@ -1247,7 +1244,7 @@ namespace Org.BouncyCastle.Asn1.Sec */ public static IEnumerable Names { - get { return new EnumerableProxy(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } } } diff --git a/crypto/src/asn1/teletrust/TeleTrusTNamedCurves.cs b/crypto/src/asn1/teletrust/TeleTrusTNamedCurves.cs index 05060c109..f476619a7 100644 --- a/crypto/src/asn1/teletrust/TeleTrusTNamedCurves.cs +++ b/crypto/src/asn1/teletrust/TeleTrusTNamedCurves.cs @@ -387,35 +387,33 @@ namespace Org.BouncyCastle.Asn1.TeleTrust DerObjectIdentifier oid, X9ECParametersHolder holder) { - objIds.Add(name, oid); + objIds.Add(Platform.ToLowerInvariant(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); + 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 = (DerObjectIdentifier) - objIds[Platform.ToLowerInvariant(name)]; - + DerObjectIdentifier oid = GetOid(name); return oid == null ? null : GetByOid(oid); } @@ -428,8 +426,7 @@ namespace Org.BouncyCastle.Asn1.TeleTrust public static X9ECParameters GetByOid( DerObjectIdentifier oid) { - X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid]; - + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; return holder == null ? null : holder.Parameters; } @@ -451,17 +448,16 @@ namespace Org.BouncyCastle.Asn1.TeleTrust public static string GetName( DerObjectIdentifier oid) { - return (string) names[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(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } public static DerObjectIdentifier GetOid( diff --git a/crypto/src/asn1/x9/ECNamedCurveTable.cs b/crypto/src/asn1/x9/ECNamedCurveTable.cs index 0030d376b..70b04a583 100644 --- a/crypto/src/asn1/x9/ECNamedCurveTable.cs +++ b/crypto/src/asn1/x9/ECNamedCurveTable.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Asn1.Anssi; using Org.BouncyCastle.Asn1.Nist; using Org.BouncyCastle.Asn1.Sec; using Org.BouncyCastle.Asn1.TeleTrust; @@ -32,12 +33,17 @@ namespace Org.BouncyCastle.Asn1.X9 if (ecP == null) { + ecP = NistNamedCurves.GetByName(name); + } + + if (ecP == null) + { ecP = TeleTrusTNamedCurves.GetByName(name); } if (ecP == null) { - ecP = NistNamedCurves.GetByName(name); + ecP = AnssiNamedCurves.GetByName(name); } return ecP; @@ -60,12 +66,17 @@ namespace Org.BouncyCastle.Asn1.X9 if (oid == null) { + oid = NistNamedCurves.GetOid(name); + } + + if (oid == null) + { oid = TeleTrusTNamedCurves.GetOid(name); } if (oid == null) { - oid = NistNamedCurves.GetOid(name); + oid = AnssiNamedCurves.GetOid(name); } return oid; @@ -111,6 +122,7 @@ namespace Org.BouncyCastle.Asn1.X9 CollectionUtilities.AddRange(v, SecNamedCurves.Names); CollectionUtilities.AddRange(v, NistNamedCurves.Names); CollectionUtilities.AddRange(v, TeleTrusTNamedCurves.Names); + CollectionUtilities.AddRange(v, AnssiNamedCurves.Names); return v; } } diff --git a/crypto/src/asn1/x9/X962NamedCurves.cs b/crypto/src/asn1/x9/X962NamedCurves.cs index 6b76c4eb4..a9ea0240c 100644 --- a/crypto/src/asn1/x9/X962NamedCurves.cs +++ b/crypto/src/asn1/x9/X962NamedCurves.cs @@ -666,7 +666,7 @@ namespace Org.BouncyCastle.Asn1.X9 DerObjectIdentifier oid, X9ECParametersHolder holder) { - objIds.Add(name, oid); + objIds.Add(Platform.ToLowerInvariant(name), oid); names.Add(oid, name); curves.Add(oid, holder); } @@ -701,8 +701,7 @@ namespace Org.BouncyCastle.Asn1.X9 public static X9ECParameters GetByName( string name) { - DerObjectIdentifier oid = (DerObjectIdentifier)objIds[Platform.ToLowerInvariant(name)]; - + DerObjectIdentifier oid = GetOid(name); return oid == null ? null : GetByOid(oid); } @@ -715,8 +714,7 @@ namespace Org.BouncyCastle.Asn1.X9 public static X9ECParameters GetByOid( DerObjectIdentifier oid) { - X9ECParametersHolder holder = (X9ECParametersHolder) curves[oid]; - + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; return holder == null ? null : holder.Parameters; } @@ -738,7 +736,7 @@ namespace Org.BouncyCastle.Asn1.X9 public static string GetName( DerObjectIdentifier oid) { - return (string) names[oid]; + return (string)names[oid]; } /** @@ -747,7 +745,7 @@ namespace Org.BouncyCastle.Asn1.X9 */ public static IEnumerable Names { - get { return new EnumerableProxy(objIds.Keys); } + get { return new EnumerableProxy(names.Values); } } } } diff --git a/crypto/src/crypto/ec/CustomNamedCurves.cs b/crypto/src/crypto/ec/CustomNamedCurves.cs index 8ff1d24c7..a7eb6a704 100644 --- a/crypto/src/crypto/ec/CustomNamedCurves.cs +++ b/crypto/src/crypto/ec/CustomNamedCurves.cs @@ -272,43 +272,53 @@ namespace Org.BouncyCastle.Crypto.EC } } + private static readonly IDictionary nameToCurve = Platform.CreateHashtable(); private static readonly IDictionary nameToOid = Platform.CreateHashtable(); private static readonly IDictionary oidToCurve = Platform.CreateHashtable(); private static readonly IDictionary oidToName = Platform.CreateHashtable(); + private static readonly IList names = Platform.CreateArrayList(); private static void DefineCurve(string name, X9ECParametersHolder holder) { + names.Add(name); + name = Platform.ToLowerInvariant(name); nameToCurve.Add(name, holder); } - private static void DefineCurve(string name, DerObjectIdentifier oid, X9ECParametersHolder holder) + private static void DefineCurveWithOid(string name, DerObjectIdentifier oid, X9ECParametersHolder holder) { - nameToCurve.Add(name, holder); - nameToOid.Add(name, oid); + names.Add(name); oidToName.Add(oid, name); oidToCurve.Add(oid, holder); + name = Platform.ToLowerInvariant(name); + nameToOid.Add(name, oid); + nameToCurve.Add(name, holder); } - private static void DefineCurveAlias(string alias, DerObjectIdentifier oid) + private static void DefineCurveAlias(string name, DerObjectIdentifier oid) { - alias = Platform.ToLowerInvariant(alias); - nameToOid.Add(alias, oid); - nameToCurve.Add(alias, oidToCurve[oid]); + object curve = oidToCurve[oid]; + if (curve == null) + throw new InvalidOperationException(); + + name = Platform.ToLowerInvariant(name); + nameToOid.Add(name, oid); + nameToCurve.Add(name, curve); } static CustomNamedCurves() { DefineCurve("curve25519", Curve25519Holder.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); + 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); DefineCurveAlias("P-192", SecObjectIdentifiers.SecP192r1); DefineCurveAlias("P-224", SecObjectIdentifiers.SecP224r1); @@ -360,7 +370,7 @@ namespace Org.BouncyCastle.Crypto.EC */ public static IEnumerable Names { - get { return new EnumerableProxy(nameToCurve.Keys); } + get { return new EnumerableProxy(names); } } } } diff --git a/crypto/src/crypto/tls/AbstractTlsServer.cs b/crypto/src/crypto/tls/AbstractTlsServer.cs index 7fe3fcbe5..c3e250fd8 100644 --- a/crypto/src/crypto/tls/AbstractTlsServer.cs +++ b/crypto/src/crypto/tls/AbstractTlsServer.cs @@ -140,7 +140,11 @@ namespace Org.BouncyCastle.Crypto.Tls 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); diff --git a/crypto/src/crypto/tls/DtlsClientProtocol.cs b/crypto/src/crypto/tls/DtlsClientProtocol.cs index 76635065c..411e7cca2 100644 --- a/crypto/src/crypto/tls/DtlsClientProtocol.cs +++ b/crypto/src/crypto/tls/DtlsClientProtocol.cs @@ -112,41 +112,12 @@ namespace Org.BouncyCastle.Crypto.Tls throw new TlsFatalAlert(AlertDescription.unexpected_message); } - if (state.maxFragmentLength >= 0) - { - int plainTextLimit = 1 << (8 + state.maxFragmentLength); - recordLayer.SetPlaintextLimit(plainTextLimit); - } - - securityParameters.cipherSuite = state.selectedCipherSuite; - securityParameters.compressionAlgorithm = (byte)state.selectedCompressionMethod; - securityParameters.prfAlgorithm = TlsProtocol.GetPrfAlgorithm(state.clientContext, state.selectedCipherSuite); - - /* - * RFC 5264 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; - handshake.NotifyHelloComplete(); - bool resumedSession = state.selectedSessionID.Length > 0 && state.tlsSession != null - && Arrays.AreEqual(state.selectedSessionID, state.tlsSession.SessionID); + ApplyMaxFragmentLengthExtension(recordLayer, securityParameters.maxFragmentLength); - if (resumedSession) + if (state.resumedSession) { - if (securityParameters.CipherSuite != state.sessionParameters.CipherSuite - || securityParameters.CompressionAlgorithm != state.sessionParameters.CompressionAlgorithm) - { - throw new TlsFatalAlert(AlertDescription.illegal_parameter); - } - - IDictionary sessionServerExtensions = state.sessionParameters.ReadServerExtensions(); - - // TODO Check encrypt-then-MAC extension and maybe others - - securityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(sessionServerExtensions); - securityParameters.masterSecret = Arrays.Clone(state.sessionParameters.MasterSecret); recordLayer.InitPendingEpoch(state.client.GetCipher()); @@ -366,12 +337,14 @@ namespace Org.BouncyCastle.Crypto.Tls if (state.tlsSession != null) { state.sessionParameters = new SessionParameters.Builder() - .SetCipherSuite(securityParameters.cipherSuite) - .SetCompressionAlgorithm(securityParameters.compressionAlgorithm) - .SetMasterSecret(securityParameters.masterSecret) + .SetCipherSuite(securityParameters.CipherSuite) + .SetCompressionAlgorithm(securityParameters.CompressionAlgorithm) + .SetMasterSecret(securityParameters.MasterSecret) .SetPeerCertificate(serverCertificate) - .SetPskIdentity(securityParameters.pskIdentity) - .SetSrpIdentity(securityParameters.srpIdentity) + .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); @@ -599,8 +572,10 @@ namespace Org.BouncyCastle.Crypto.Tls MemoryStream buf = new MemoryStream(body, false); - ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); - ReportServerVersion(state, server_version); + { + ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); + ReportServerVersion(state, server_version); + } securityParameters.serverRandom = TlsUtilities.ReadFully(32, buf); @@ -608,24 +583,24 @@ namespace Org.BouncyCastle.Crypto.Tls 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); - state.selectedCipherSuite = TlsUtilities.ReadUint16(buf); - if (!Arrays.Contains(state.offeredCipherSuites, state.selectedCipherSuite) - || state.selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL - || CipherSuite.IsScsv(state.selectedCipherSuite) - || !TlsUtilities.IsValidCipherSuiteForVersion(state.selectedCipherSuite, server_version)) + 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); - ValidateSelectedCipherSuite(state.selectedCipherSuite, AlertDescription.illegal_parameter); - - state.client.NotifySelectedCipherSuite(state.selectedCipherSuite); - - state.selectedCompressionMethod = TlsUtilities.ReadUint8(buf); - if (!Arrays.Contains(state.offeredCompressionMethods, (byte)state.selectedCompressionMethod)) + byte selectedCompressionMethod = TlsUtilities.ReadUint8(buf); + if (!Arrays.Contains(state.offeredCompressionMethods, selectedCompressionMethod)) throw new TlsFatalAlert(AlertDescription.illegal_parameter); - state.client.NotifySelectedCompressionMethod((byte)state.selectedCompressionMethod); + state.client.NotifySelectedCompressionMethod(selectedCompressionMethod); /* * RFC3546 2.2 The extended server hello message format MAY be sent in place of the server @@ -643,16 +618,16 @@ namespace Org.BouncyCastle.Crypto.Tls */ // Integer -> byte[] - IDictionary serverExtensions = TlsProtocol.ReadExtensions(buf); + state.serverExtensions = TlsProtocol.ReadExtensions(buf); /* * 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 (serverExtensions != null) + if (state.serverExtensions != null) { - foreach (int extType in serverExtensions.Keys) + foreach (int extType in state.serverExtensions.Keys) { /* * RFC 5746 3.6. Note that sending a "renegotiation_info" extension in response to a @@ -679,64 +654,92 @@ namespace Org.BouncyCastle.Crypto.Tls * extensions appearing in the client hello, and send a server hello containing no * extensions[.] */ - // TODO[sessions] - // 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); - // } + 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 + */ + { /* - * 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) { /* - * When a ServerHello is received, the client MUST check if it includes the - * "renegotiation_info" extension: - */ - byte[] renegExtData = (byte[])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); - } + * 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); } + } - /* - * 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(serverExtensions); - if (serverSentEncryptThenMAC && !TlsUtilities.IsBlockCipherSuite(state.selectedCipherSuite)) + // 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); + } - securityParameters.encryptThenMac = serverSentEncryptThenMAC; + sessionClientExtensions = null; + sessionServerExtensions = state.sessionParameters.ReadServerExtensions(); + } - securityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(serverExtensions); + securityParameters.cipherSuite = selectedCipherSuite; + securityParameters.compressionAlgorithm = selectedCompressionMethod; - state.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.clientExtensions, serverExtensions, - AlertDescription.illegal_parameter); + if (sessionServerExtensions != null) + { + { + /* + * 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.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(serverExtensions); + securityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(sessionServerExtensions); + + securityParameters.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.resumedSession, + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); - state.allowCertificateStatus = TlsUtilities.HasExpectedEmptyExtensionData(serverExtensions, - ExtensionType.status_request, 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 = TlsUtilities.HasExpectedEmptyExtensionData(serverExtensions, - ExtensionType.session_ticket, AlertDescription.illegal_parameter); + state.expectSessionTicket = !state.resumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.session_ticket, + AlertDescription.illegal_parameter); } /* @@ -746,12 +749,19 @@ namespace Org.BouncyCastle.Crypto.Tls * that do not use the extended master secret [..]. (and see 5.2, 5.3) */ - state.client.NotifySecureRenegotiation(state.secure_renegotiation); - - if (state.clientExtensions != null) + if (sessionClientExtensions != null) { - state.client.ProcessServerExtensions(serverExtensions); + state.client.ProcessServerExtensions(sessionServerExtensions); } + + securityParameters.prfAlgorithm = TlsProtocol.GetPrfAlgorithm(state.clientContext, + securityParameters.CipherSuite); + + /* + * RFC 5264 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) @@ -813,11 +823,10 @@ namespace Org.BouncyCastle.Crypto.Tls internal int[] offeredCipherSuites = null; internal byte[] offeredCompressionMethods = null; internal IDictionary clientExtensions = null; + internal IDictionary serverExtensions = null; internal byte[] selectedSessionID = null; - internal int selectedCipherSuite = -1; - internal short selectedCompressionMethod = -1; + internal bool resumedSession = false; internal bool secure_renegotiation = false; - internal short maxFragmentLength = -1; internal bool allowCertificateStatus = false; internal bool expectSessionTicket = false; internal TlsKeyExchange keyExchange = null; diff --git a/crypto/src/crypto/tls/DtlsProtocol.cs b/crypto/src/crypto/tls/DtlsProtocol.cs index 6d62c5a90..e4ebd436c 100644 --- a/crypto/src/crypto/tls/DtlsProtocol.cs +++ b/crypto/src/crypto/tls/DtlsProtocol.cs @@ -33,12 +33,32 @@ namespace Org.BouncyCastle.Crypto.Tls } /// <exception cref="IOException"/> - protected static short EvaluateMaxFragmentLengthExtension(IDictionary clientExtensions, IDictionary serverExtensions, - byte alertDescription) + 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); + } + } + + /// <exception cref="IOException"/> + protected static short EvaluateMaxFragmentLengthExtension(bool resumedSession, IDictionary clientExtensions, + IDictionary serverExtensions, byte alertDescription) { short maxFragmentLength = TlsExtensionsUtilities.GetMaxFragmentLengthExtension(serverExtensions); - if (maxFragmentLength >= 0 && maxFragmentLength != TlsExtensionsUtilities.GetMaxFragmentLengthExtension(clientExtensions)) - throw new TlsFatalAlert(alertDescription); + if (maxFragmentLength >= 0) + { + if (!MaxFragmentLength.IsValid((byte)maxFragmentLength) + || (!resumedSession && maxFragmentLength != TlsExtensionsUtilities + .GetMaxFragmentLengthExtension(clientExtensions))) + { + throw new TlsFatalAlert(alertDescription); + } + } return maxFragmentLength; } diff --git a/crypto/src/crypto/tls/DtlsServerProtocol.cs b/crypto/src/crypto/tls/DtlsServerProtocol.cs index f148eb7d7..9c7caf290 100644 --- a/crypto/src/crypto/tls/DtlsServerProtocol.cs +++ b/crypto/src/crypto/tls/DtlsServerProtocol.cs @@ -94,24 +94,9 @@ namespace Org.BouncyCastle.Crypto.Tls { byte[] serverHelloBody = GenerateServerHello(state); - - if (state.maxFragmentLength >= 0) - { - int plainTextLimit = 1 << (8 + state.maxFragmentLength); - recordLayer.SetPlaintextLimit(plainTextLimit); - } - - securityParameters.cipherSuite = state.selectedCipherSuite; - securityParameters.compressionAlgorithm = (byte)state.selectedCompressionMethod; - securityParameters.prfAlgorithm = TlsProtocol.GetPrfAlgorithm(state.serverContext, - state.selectedCipherSuite); - /* - * RFC 5264 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; - + ApplyMaxFragmentLengthExtension(recordLayer, securityParameters.maxFragmentLength); + handshake.SendMessage(HandshakeType.server_hello, serverHelloBody); } @@ -302,17 +287,19 @@ namespace Org.BouncyCastle.Crypto.Tls MemoryStream buf = new MemoryStream(); - ProtocolVersion server_version = state.server.GetServerVersion(); - if (!server_version.IsEqualOrEarlierVersionOf(state.serverContext.ClientVersion)) - throw new TlsFatalAlert(AlertDescription.internal_error); + { + 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); + // 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); + TlsUtilities.WriteVersion(state.serverContext.ServerVersion, buf); + } buf.Write(securityParameters.ServerRandom, 0, securityParameters.ServerRandom.Length); @@ -322,23 +309,24 @@ namespace Org.BouncyCastle.Crypto.Tls */ TlsUtilities.WriteOpaque8(TlsUtilities.EmptyBytes, buf); - state.selectedCipherSuite = state.server.GetSelectedCipherSuite(); - if (!Arrays.Contains(state.offeredCipherSuites, state.selectedCipherSuite) - || state.selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL - || CipherSuite.IsScsv(state.selectedCipherSuite) - || !TlsUtilities.IsValidCipherSuiteForVersion(state.selectedCipherSuite, server_version)) + 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; - ValidateSelectedCipherSuite(state.selectedCipherSuite, AlertDescription.internal_error); - - state.selectedCompressionMethod = state.server.GetSelectedCompressionMethod(); - if (!Arrays.Contains(state.offeredCompressionMethods, (byte)state.selectedCompressionMethod)) + byte selectedCompressionMethod = state.server.GetSelectedCompressionMethod(); + if (!Arrays.Contains(state.offeredCompressionMethods, selectedCompressionMethod)) throw new TlsFatalAlert(AlertDescription.internal_error); + securityParameters.compressionAlgorithm = selectedCompressionMethod; - TlsUtilities.WriteUint16(state.selectedCipherSuite, buf); - TlsUtilities.WriteUint8((byte)state.selectedCompressionMethod, buf); + TlsUtilities.WriteUint16(selectedCipherSuite, buf); + TlsUtilities.WriteUint8(selectedCompressionMethod, buf); state.serverExtensions = state.server.GetServerExtensions(); @@ -375,24 +363,45 @@ namespace Org.BouncyCastle.Crypto.Tls 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 != null) { securityParameters.encryptThenMac = TlsExtensionsUtilities.HasEncryptThenMacExtension(state.serverExtensions); - state.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.clientExtensions, state.serverExtensions, - AlertDescription.internal_error); + securityParameters.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.resumedSession, + state.clientExtensions, state.serverExtensions, AlertDescription.internal_error); securityParameters.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(state.serverExtensions); - state.allowCertificateStatus = TlsUtilities.HasExpectedEmptyExtensionData(state.serverExtensions, - ExtensionType.status_request, AlertDescription.internal_error); + /* + * 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 = TlsUtilities.HasExpectedEmptyExtensionData(state.serverExtensions, - ExtensionType.session_ticket, 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 5264 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(); } @@ -628,16 +637,14 @@ namespace Org.BouncyCastle.Crypto.Tls { internal TlsServer server = null; internal TlsServerContextImpl serverContext = null; - internal int[] offeredCipherSuites; - internal byte[] offeredCompressionMethods; - internal IDictionary clientExtensions; - internal int selectedCipherSuite = -1; - internal short selectedCompressionMethod = -1; + 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 short maxFragmentLength = -1; internal bool allowCertificateStatus = false; internal bool expectSessionTicket = false; - internal IDictionary serverExtensions = null; internal TlsKeyExchange keyExchange = null; internal TlsCredentials serverCredentials = null; internal CertificateRequest certificateRequest = null; diff --git a/crypto/src/crypto/tls/TlsClientProtocol.cs b/crypto/src/crypto/tls/TlsClientProtocol.cs index 5b9e81b3f..7b8439acc 100644 --- a/crypto/src/crypto/tls/TlsClientProtocol.cs +++ b/crypto/src/crypto/tls/TlsClientProtocol.cs @@ -224,24 +224,10 @@ namespace Org.BouncyCastle.Crypto.Tls ReceiveServerHelloMessage(buf); this.mConnectionState = CS_SERVER_HELLO; - if (this.mSecurityParameters.maxFragmentLength >= 0) - { - int plainTextLimit = 1 << (8 + this.mSecurityParameters.maxFragmentLength); - mRecordStream.SetPlaintextLimit(plainTextLimit); - } - - this.mSecurityParameters.prfAlgorithm = GetPrfAlgorithm(Context, - this.mSecurityParameters.CipherSuite); - - /* - * RFC 5264 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; - this.mRecordStream.NotifyHelloComplete(); + ApplyMaxFragmentLengthExtension(); + if (this.mResumedSession) { this.mSecurityParameters.masterSecret = Arrays.Clone(this.mSessionParameters.MasterSecret); @@ -558,21 +544,23 @@ namespace Org.BouncyCastle.Crypto.Tls protected virtual void ReceiveServerHelloMessage(MemoryStream buf) { - ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); - if (server_version.IsDtls) - throw new TlsFatalAlert(AlertDescription.illegal_parameter); + { + 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); + // 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); + 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); + this.mRecordStream.SetWriteVersion(server_version); + ContextAdmin.SetServerVersion(server_version); + this.mTlsClient.NotifyServerVersion(server_version); + } /* * Read the server random @@ -582,9 +570,7 @@ namespace Org.BouncyCastle.Crypto.Tls 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); @@ -596,11 +582,10 @@ namespace Org.BouncyCastle.Crypto.Tls if (!Arrays.Contains(this.mOfferedCipherSuites, selectedCipherSuite) || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL || CipherSuite.IsScsv(selectedCipherSuite) - || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, server_version)) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, Context.ServerVersion)) { throw new TlsFatalAlert(AlertDescription.illegal_parameter); } - this.mTlsClient.NotifySelectedCipherSuite(selectedCipherSuite); /* @@ -610,7 +595,6 @@ namespace Org.BouncyCastle.Crypto.Tls byte selectedCompressionMethod = TlsUtilities.ReadUint8(buf); if (!Arrays.Contains(this.mOfferedCompressionMethods, selectedCompressionMethod)) throw new TlsFatalAlert(AlertDescription.illegal_parameter); - this.mTlsClient.NotifySelectedCompressionMethod(selectedCompressionMethod); /* @@ -714,17 +698,19 @@ namespace Org.BouncyCastle.Crypto.Tls if (sessionServerExtensions != null) { - /* - * 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); + { + /* + * 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.encryptThenMac = serverSentEncryptThenMAC; + } this.mSecurityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(sessionServerExtensions); @@ -757,6 +743,15 @@ namespace Org.BouncyCastle.Crypto.Tls { this.mTlsClient.ProcessServerExtensions(sessionServerExtensions); } + + this.mSecurityParameters.prfAlgorithm = GetPrfAlgorithm(Context, this.mSecurityParameters.CipherSuite); + + /* + * RFC 5264 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) diff --git a/crypto/src/crypto/tls/TlsProtocol.cs b/crypto/src/crypto/tls/TlsProtocol.cs index 4ea72cd57..8eb7beb3f 100644 --- a/crypto/src/crypto/tls/TlsProtocol.cs +++ b/crypto/src/crypto/tls/TlsProtocol.cs @@ -99,6 +99,18 @@ namespace Org.BouncyCastle.Crypto.Tls { } + 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) @@ -164,12 +176,12 @@ namespace Org.BouncyCastle.Crypto.Tls if (this.mSessionParameters == null) { this.mSessionParameters = new SessionParameters.Builder() - .SetCipherSuite(this.mSecurityParameters.cipherSuite) - .SetCompressionAlgorithm(this.mSecurityParameters.compressionAlgorithm) - .SetMasterSecret(this.mSecurityParameters.masterSecret) + .SetCipherSuite(this.mSecurityParameters.CipherSuite) + .SetCompressionAlgorithm(this.mSecurityParameters.CompressionAlgorithm) + .SetMasterSecret(this.mSecurityParameters.MasterSecret) .SetPeerCertificate(this.mPeerCertificate) - .SetPskIdentity(this.mSecurityParameters.pskIdentity) - .SetSrpIdentity(this.mSecurityParameters.srpIdentity) + .SetPskIdentity(this.mSecurityParameters.PskIdentity) + .SetSrpIdentity(this.mSecurityParameters.SrpIdentity) // TODO Consider filtering extensions that aren't relevant to resumed sessions .SetServerExtensions(this.mServerExtensions) .Build(); @@ -761,10 +773,14 @@ namespace Org.BouncyCastle.Crypto.Tls byte alertDescription) { short maxFragmentLength = TlsExtensionsUtilities.GetMaxFragmentLengthExtension(serverExtensions); - if (maxFragmentLength >= 0 && !this.mResumedSession) + if (maxFragmentLength >= 0) { - if (maxFragmentLength != TlsExtensionsUtilities.GetMaxFragmentLengthExtension(clientExtensions)) + if (!MaxFragmentLength.IsValid((byte)maxFragmentLength) + || (!this.mResumedSession && maxFragmentLength != TlsExtensionsUtilities + .GetMaxFragmentLengthExtension(clientExtensions))) + { throw new TlsFatalAlert(alertDescription); + } } return maxFragmentLength; } diff --git a/crypto/src/crypto/tls/TlsServerProtocol.cs b/crypto/src/crypto/tls/TlsServerProtocol.cs index fd6808382..b73cb5a30 100644 --- a/crypto/src/crypto/tls/TlsServerProtocol.cs +++ b/crypto/src/crypto/tls/TlsServerProtocol.cs @@ -106,6 +106,8 @@ namespace Org.BouncyCastle.Crypto.Tls SendServerHelloMessage(); this.mConnectionState = CS_SERVER_HELLO; + mRecordStream.NotifyHelloComplete(); + IList serverSupplementalData = mTlsServer.GetServerSupplementalData(); if (serverSupplementalData != null) { @@ -618,16 +620,18 @@ namespace Org.BouncyCastle.Crypto.Tls { HandshakeMessage message = new HandshakeMessage(HandshakeType.server_hello); - ProtocolVersion server_version = mTlsServer.GetServerVersion(); - if (!server_version.IsEqualOrEarlierVersionOf(Context.ClientVersion)) - throw new TlsFatalAlert(AlertDescription.internal_error); + { + 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); + mRecordStream.ReadVersion = server_version; + mRecordStream.SetWriteVersion(server_version); + mRecordStream.SetRestrictReadVersion(true); + ContextAdmin.SetServerVersion(server_version); - TlsUtilities.WriteVersion(server_version, message); + TlsUtilities.WriteVersion(server_version, message); + } message.Write(this.mSecurityParameters.serverRandom); @@ -641,7 +645,7 @@ namespace Org.BouncyCastle.Crypto.Tls if (!Arrays.Contains(mOfferedCipherSuites, selectedCipherSuite) || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL || CipherSuite.IsScsv(selectedCipherSuite) - || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, server_version)) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, Context.ServerVersion)) { throw new TlsFatalAlert(AlertDescription.internal_error); } @@ -722,12 +726,6 @@ namespace Org.BouncyCastle.Crypto.Tls WriteExtensions(message, this.mServerExtensions); } - if (mSecurityParameters.maxFragmentLength >= 0) - { - int plainTextLimit = 1 << (8 + mSecurityParameters.maxFragmentLength); - mRecordStream.SetPlaintextLimit(plainTextLimit); - } - mSecurityParameters.prfAlgorithm = GetPrfAlgorithm(Context, mSecurityParameters.CipherSuite); /* @@ -736,9 +734,9 @@ namespace Org.BouncyCastle.Crypto.Tls */ mSecurityParameters.verifyDataLength = 12; - message.WriteToRecordStream(this); + ApplyMaxFragmentLengthExtension(); - this.mRecordStream.NotifyHelloComplete(); + message.WriteToRecordStream(this); } protected virtual void SendServerHelloDoneMessage() diff --git a/crypto/src/math/ec/ECCurve.cs b/crypto/src/math/ec/ECCurve.cs index 339d37f7c..9fe9e32fd 100644 --- a/crypto/src/math/ec/ECCurve.cs +++ b/crypto/src/math/ec/ECCurve.cs @@ -623,6 +623,18 @@ namespace Org.BouncyCastle.Math.EC 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 <code>s<sub>0</sub></code> and + * <code>s<sub>1</sub></code> 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) @@ -657,6 +669,69 @@ namespace Org.BouncyCastle.Math.EC : base(BuildField(m, k1, k2, k3)) { } + + [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); + } + + /** + * @return the auxiliary values <code>s<sub>0</sub></code> and + * <code>s<sub>1</sub></code> 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); + } + } } /** @@ -705,19 +780,6 @@ namespace Org.BouncyCastle.Math.EC protected readonly F2mPoint m_infinity; /** - * The parameter <code>μ</code> of the elliptic curve if this is - * a Koblitz curve. - */ - private sbyte mu = 0; - - /** - * The auxiliary values <code>s<sub>0</sub></code> and - * <code>s<sub>1</sub></code> used for partial modular reduction for - * Koblitz curves. - */ - private BigInteger[] si = null; - - /** * Constructor for Trinomial Polynomial Basis (TPB). * @param m The exponent <code>m</code> of * <code>F<sub>2<sup>m</sup></sub></code>. @@ -917,37 +979,6 @@ namespace Org.BouncyCastle.Math.EC return new F2mFieldElement(this.m, this.k1, this.k2, this.k3, x); } - [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 internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) { return new F2mPoint(this, x, y, withCompression); @@ -963,60 +994,6 @@ namespace Org.BouncyCastle.Math.EC get { return m_infinity; } } - /** - * 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); - } - } - - /** - * Returns the parameter <code>μ</code> of the elliptic curve. - * @return <code>μ</code> of the elliptic curve. - * @throws ArgumentException if the given ECCurve is not a - * Koblitz curve. - */ - internal virtual sbyte GetMu() - { - if (mu == 0) - { - lock (this) - { - if (mu == 0) - { - mu = Tnaf.GetMu(this); - } - } - } - - return mu; - } - - /** - * @return the auxiliary values <code>s<sub>0</sub></code> and - * <code>s<sub>1</sub></code> 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; - } - protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) { ECFieldElement xp = FromBigInteger(X1), yp = null; @@ -1086,7 +1063,7 @@ namespace Org.BouncyCastle.Math.EC ECFieldElement t = FromBigInteger(new BigInteger(m, rand)); z = zeroElement; ECFieldElement w = beta; - for (int i = 1; i <= m - 1; i++) + for (int i = 1; i < m; i++) { ECFieldElement w2 = w.Square(); z = z.Square().Add(w2.Multiply(t)); diff --git a/crypto/src/math/ec/ECFieldElement.cs b/crypto/src/math/ec/ECFieldElement.cs index e589fc737..844bed649 100644 --- a/crypto/src/math/ec/ECFieldElement.cs +++ b/crypto/src/math/ec/ECFieldElement.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC @@ -55,6 +56,16 @@ namespace Org.BouncyCastle.Math.EC 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); @@ -812,6 +823,11 @@ namespace Org.BouncyCastle.Math.EC 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)); @@ -819,14 +835,7 @@ namespace Org.BouncyCastle.Math.EC public override ECFieldElement Sqrt() { - LongArray x1 = this.x; - if (x1.IsOne() || x1.IsZero()) - { - return this; - } - - LongArray x2 = x1.ModSquareN(m - 1, m, ks); - return new F2mFieldElement(m, ks, x2); + return (x.IsZero() || x.IsOne()) ? this : SquarePow(m - 1); } /** diff --git a/crypto/src/math/ec/ECPoint.cs b/crypto/src/math/ec/ECPoint.cs index 3e206e65f..a5ba515c5 100644 --- a/crypto/src/math/ec/ECPoint.cs +++ b/crypto/src/math/ec/ECPoint.cs @@ -1383,6 +1383,139 @@ namespace Org.BouncyCastle.Math.EC return lhs.Equals(rhs); } + + 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"); + } + } + } } /** @@ -1491,66 +1624,6 @@ namespace Org.BouncyCastle.Math.EC } } - 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); - } - } - } - protected internal override bool CompressionYTilde { get @@ -1579,44 +1652,8 @@ namespace Org.BouncyCastle.Math.EC } } - /** - * Check, if two <code>ECPoint</code>s can be added or subtracted. - * @param a The first <code>ECPoint</code> to check. - * @param b The second <code>ECPoint</code> to check. - * @throws IllegalArgumentException if <code>a</code> and <code>b</code> - * cannot be added. - */ - private static void CheckPoints( - ECPoint a, - ECPoint b) - { - // Check, if points are on the same curve - if (!a.Curve.Equals(b.Curve)) - throw new ArgumentException("Only points on the same curve can be added or subtracted"); - -// F2mFieldElement.CheckFieldElements(a.x, b.x); - } - - /* (non-Javadoc) - * @see org.bouncycastle.math.ec.ECPoint#add(org.bouncycastle.math.ec.ECPoint) - */ public override ECPoint Add(ECPoint b) { - CheckPoints(this, b); - return AddSimple((F2mPoint) b); - } - - /** - * Adds another <code>ECPoints.F2m</code> to <code>this</code> without - * checking if both points are on the same curve. Used by multiplication - * algorithms, because there all points are a multiple of the same point - * and hence the checks can be omitted. - * @param b The other <code>ECPoints.F2m</code> to add to - * <code>this</code>. - * @return <code>this + b</code> - */ - internal F2mPoint AddSimple(F2mPoint b) - { if (this.IsInfinity) return b; if (b.IsInfinity) @@ -1640,10 +1677,10 @@ namespace Org.BouncyCastle.Math.EC { if (dy.IsZero) { - return (F2mPoint)Twice(); + return Twice(); } - return (F2mPoint)curve.Infinity; + return curve.Infinity; } ECFieldElement L = dy.Divide(dx); @@ -1681,10 +1718,10 @@ namespace Org.BouncyCastle.Math.EC { if (U.IsZero) { - return (F2mPoint)Twice(); + return Twice(); } - return (F2mPoint)curve.Infinity; + return curve.Infinity; } ECFieldElement VSq = V.Square(); @@ -1705,9 +1742,9 @@ namespace Org.BouncyCastle.Math.EC if (X1.IsZero) { if (X2.IsZero) - return (F2mPoint)curve.Infinity; + return curve.Infinity; - return b.AddSimple(this); + return b.Add(this); } ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; @@ -1736,10 +1773,10 @@ namespace Org.BouncyCastle.Math.EC { if (A.IsZero) { - return (F2mPoint)Twice(); + return Twice(); } - return (F2mPoint)curve.Infinity; + return curve.Infinity; } ECFieldElement X3, L3, Z3; @@ -1801,68 +1838,6 @@ namespace Org.BouncyCastle.Math.EC } /* (non-Javadoc) - * @see org.bouncycastle.math.ec.ECPoint#subtract(org.bouncycastle.math.ec.ECPoint) - */ - public override ECPoint Subtract( - ECPoint b) - { - CheckPoints(this, b); - return SubtractSimple((F2mPoint) b); - } - - /** - * Subtracts another <code>ECPoints.F2m</code> from <code>this</code> - * without checking if both points are on the same curve. Used by - * multiplication algorithms, because there all points are a multiple - * of the same point and hence the checks can be omitted. - * @param b The other <code>ECPoints.F2m</code> to subtract from - * <code>this</code>. - * @return <code>this - b</code> - */ - internal F2mPoint SubtractSimple( - F2mPoint b) - { - if (b.IsInfinity) - return this; - - // Add -b - return AddSimple((F2mPoint) b.Negate()); - } - - public virtual F2mPoint 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 new F2mPoint(curve, X1.Square(), Y1.Square(), IsCompressed); - } - case ECCurve.COORD_HOMOGENEOUS: - case ECCurve.COORD_LAMBDA_PROJECTIVE: - { - ECFieldElement Y1 = this.RawYCoord, Z1 = this.RawZCoords[0]; - return new F2mPoint(curve, X1.Square(), Y1.Square(), new ECFieldElement[] { Z1.Square() }, IsCompressed); - } - default: - { - throw new InvalidOperationException("unsupported coordinate system"); - } - } - } - - /* (non-Javadoc) * @see Org.BouncyCastle.Math.EC.ECPoint#twice() */ public override ECPoint Twice() diff --git a/crypto/src/math/ec/LongArray.cs b/crypto/src/math/ec/LongArray.cs index c4e3dacbc..84462e0ea 100644 --- a/crypto/src/math/ec/LongArray.cs +++ b/crypto/src/math/ec/LongArray.cs @@ -13,7 +13,7 @@ namespace Org.BouncyCastle.Math.EC * 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 int[] INTERLEAVE2_TABLE = new int[] + private static readonly ushort[] INTERLEAVE2_TABLE = new ushort[] { 0x0000, 0x0001, 0x0004, 0x0005, 0x0010, 0x0011, 0x0014, 0x0015, 0x0040, 0x0041, 0x0044, 0x0045, 0x0050, 0x0051, 0x0054, 0x0055, diff --git a/crypto/src/math/ec/abc/Tnaf.cs b/crypto/src/math/ec/abc/Tnaf.cs index 9f16886f5..b6e792aa4 100644 --- a/crypto/src/math/ec/abc/Tnaf.cs +++ b/crypto/src/math/ec/abc/Tnaf.cs @@ -384,11 +384,11 @@ namespace Org.BouncyCastle.Math.EC.Abc /** * Applies the operation <code>τ()</code> to an - * <code>F2mPoint</code>. - * @param p The F2mPoint to which <code>τ()</code> is applied. + * <code>AbstractF2mPoint</code>. + * @param p The AbstractF2mPoint to which <code>τ()</code> is applied. * @return <code>τ(p)</code> */ - public static F2mPoint Tau(F2mPoint p) + public static AbstractF2mPoint Tau(AbstractF2mPoint p) { return p.Tau(); } @@ -403,7 +403,7 @@ namespace Org.BouncyCastle.Math.EC.Abc * @throws ArgumentException if the given ECCurve is not a Koblitz * curve. */ - public static sbyte GetMu(F2mCurve curve) + public static sbyte GetMu(AbstractF2mCurve curve) { BigInteger a = curve.A.ToBigInteger(); @@ -423,6 +423,16 @@ namespace Org.BouncyCastle.Math.EC.Abc 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 <code>U<sub>k-1</sub></code> and * <code>U<sub>k</sub></code> or <code>V<sub>k-1</sub></code> and @@ -526,53 +536,60 @@ namespace Org.BouncyCastle.Math.EC.Abc * @throws ArgumentException if <code>curve</code> is not a * Koblitz curve (Anomalous Binary Curve, ABC). */ - public static BigInteger[] GetSi(F2mCurve curve) + public static BigInteger[] GetSi(AbstractF2mCurve curve) { if (!curve.IsKoblitz) throw new ArgumentException("si is defined for Koblitz curves only"); - int m = curve.M; + int m = curve.FieldSize; int a = curve.A.ToBigInteger().IntValue; - sbyte mu = curve.GetMu(); - int h = curve.Cofactor.IntValue; + sbyte mu = GetMu(a); + int shifts = GetShiftsForCofactor(curve.Cofactor); int index = m + 3 - a; BigInteger[] ui = GetLucas(mu, index, false); - BigInteger dividend0; - BigInteger dividend1; if (mu == 1) { - dividend0 = BigInteger.One.Subtract(ui[1]); - dividend1 = BigInteger.One.Subtract(ui[0]); - } - else if (mu == -1) - { - dividend0 = BigInteger.One.Add(ui[1]); - dividend1 = BigInteger.One.Add(ui[0]); - } - else - { - throw new ArgumentException("mu must be 1 or -1"); + ui[0] = ui[0].Negate(); + ui[1] = ui[1].Negate(); } - BigInteger[] si = new BigInteger[2]; + BigInteger dividend0 = BigInteger.One.Add(ui[1]).ShiftRight(shifts); + BigInteger dividend1 = BigInteger.One.Add(ui[0]).ShiftRight(shifts).Negate(); - if (h == 2) - { - si[0] = dividend0.ShiftRight(1); - si[1] = dividend1.ShiftRight(1).Negate(); - } - else if (h == 4) + 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) { - si[0] = dividend0.ShiftRight(2); - si[1] = dividend1.ShiftRight(2).Negate(); + ui[0] = ui[0].Negate(); + ui[1] = ui[1].Negate(); } - else + + 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) { - throw new ArgumentException("h (Cofactor) must be 2 or 4"); + int hi = h.IntValue; + if (hi == 2) + return 1; + if (hi == 4) + return 2; } - return si; + throw new ArgumentException("h (Cofactor) must be 2 or 4"); } /** @@ -624,70 +641,77 @@ namespace Org.BouncyCastle.Math.EC.Abc } /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by a <code>BigInteger</code> using the reduced <code>τ</code>-adic * NAF (RTNAF) method. - * @param p The F2mPoint to Multiply. + * @param p The AbstractF2mPoint to Multiply. * @param k The <code>BigInteger</code> by which to Multiply <code>p</code>. * @return <code>k * p</code> */ - public static F2mPoint MultiplyRTnaf(F2mPoint p, BigInteger k) + public static AbstractF2mPoint MultiplyRTnaf(AbstractF2mPoint p, BigInteger k) { - F2mCurve curve = (F2mCurve) p.Curve; - int m = curve.M; - sbyte a = (sbyte) curve.A.ToBigInteger().IntValue; - sbyte mu = curve.GetMu(); + 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, a, s, mu, (sbyte)10); + ZTauElement rho = PartModReduction(k, m, (sbyte)a, s, mu, (sbyte)10); return MultiplyTnaf(p, rho); } /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by an element <code>λ</code> of <code><b>Z</b>[τ]</code> * using the <code>τ</code>-adic NAF (TNAF) method. - * @param p The F2mPoint to Multiply. + * @param p The AbstractF2mPoint to Multiply. * @param lambda The element <code>λ</code> of * <code><b>Z</b>[τ]</code>. * @return <code>λ * p</code> */ - public static F2mPoint MultiplyTnaf(F2mPoint p, ZTauElement lambda) + public static AbstractF2mPoint MultiplyTnaf(AbstractF2mPoint p, ZTauElement lambda) { - F2mCurve curve = (F2mCurve)p.Curve; - sbyte mu = curve.GetMu(); + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; + sbyte mu = GetMu(curve.A); sbyte[] u = TauAdicNaf(mu, lambda); - F2mPoint q = MultiplyFromTnaf(p, u); + AbstractF2mPoint q = MultiplyFromTnaf(p, u); return q; } /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by an element <code>λ</code> of <code><b>Z</b>[τ]</code> * using the <code>τ</code>-adic NAF (TNAF) method, given the TNAF * of <code>λ</code>. - * @param p The F2mPoint to Multiply. + * @param p The AbstractF2mPoint to Multiply. * @param u The the TNAF of <code>λ</code>.. * @return <code>λ * p</code> */ - public static F2mPoint MultiplyFromTnaf(F2mPoint p, sbyte[] u) + public static AbstractF2mPoint MultiplyFromTnaf(AbstractF2mPoint p, sbyte[] u) { - F2mCurve curve = (F2mCurve)p.Curve; - F2mPoint q = (F2mPoint) curve.Infinity; + 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--) { - q = Tau(q); - if (u[i] == 1) - { - q = (F2mPoint)q.AddSimple(p); - } - else if (u[i] == -1) + ++tauCount; + sbyte ui = u[i]; + if (ui != 0) { - q = (F2mPoint)q.SubtractSimple(p); + 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; } @@ -800,28 +824,21 @@ namespace Org.BouncyCastle.Math.EC.Abc * @param a The parameter <code>a</code> of the elliptic curve. * @return The precomputation array for <code>p</code>. */ - public static F2mPoint[] GetPreComp(F2mPoint p, sbyte a) + public static AbstractF2mPoint[] GetPreComp(AbstractF2mPoint p, sbyte a) { - F2mPoint[] pu; - pu = new F2mPoint[16]; - pu[1] = p; - sbyte[][] alphaTnaf; - if (a == 0) - { - alphaTnaf = Tnaf.Alpha0Tnaf; - } - else - { - // a == 1 - alphaTnaf = Tnaf.Alpha1Tnaf; - } + sbyte[][] alphaTnaf = (a == 0) ? Tnaf.Alpha0Tnaf : Tnaf.Alpha1Tnaf; + + AbstractF2mPoint[] pu = new AbstractF2mPoint[(uint)(alphaTnaf.Length + 1) >> 1]; + pu[0] = p; - int precompLen = alphaTnaf.Length; - for (int i = 3; i < precompLen; i = i + 2) + uint precompLen = (uint)alphaTnaf.Length; + for (uint i = 3; i < precompLen; i += 2) { - pu[i] = Tnaf.MultiplyFromTnaf(p, alphaTnaf[i]); + pu[i >> 1] = Tnaf.MultiplyFromTnaf(p, alphaTnaf[i]); } - + + p.Curve.NormalizeAll(pu); + return pu; } } diff --git a/crypto/src/math/ec/custom/djb/Curve25519.cs b/crypto/src/math/ec/custom/djb/Curve25519.cs index 712b68f29..6ed7c0648 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Math.EC.Custom.Sec; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities.Encoders; namespace Org.BouncyCastle.Math.EC.Custom.Djb diff --git a/crypto/src/math/ec/custom/djb/Curve25519Field.cs b/crypto/src/math/ec/custom/djb/Curve25519Field.cs index 809e51b80..837821e1a 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519Field.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519Field.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; -using Org.BouncyCastle.Math.EC.Custom.Sec; +using Org.BouncyCastle.Math.Raw; namespace Org.BouncyCastle.Math.EC.Custom.Djb { diff --git a/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs b/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs index 8d5a80326..732e9e468 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519FieldElement.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Math.EC.Custom.Sec; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Djb diff --git a/crypto/src/math/ec/custom/djb/Curve25519Point.cs b/crypto/src/math/ec/custom/djb/Curve25519Point.cs index bfec1d11d..eb8fc12f2 100644 --- a/crypto/src/math/ec/custom/djb/Curve25519Point.cs +++ b/crypto/src/math/ec/custom/djb/Curve25519Point.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Math.EC.Custom.Sec; +using Org.BouncyCastle.Math.Raw; namespace Org.BouncyCastle.Math.EC.Custom.Djb { diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Field.cs b/crypto/src/math/ec/custom/sec/SecP192K1Field.cs index d5ca903d1..a00360360 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP192K1Field diff --git a/crypto/src/math/ec/custom/sec/SecP192K1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP192K1FieldElement.cs index 78886dd8c..dce377035 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1FieldElement.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP192K1Point.cs b/crypto/src/math/ec/custom/sec/SecP192K1Point.cs index 648aca502..58eb09102 100644 --- a/crypto/src/math/ec/custom/sec/SecP192K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP192K1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP192K1Point diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Field.cs b/crypto/src/math/ec/custom/sec/SecP192R1Field.cs index 85e3a0394..096c2b51f 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP192R1Field diff --git a/crypto/src/math/ec/custom/sec/SecP192R1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP192R1FieldElement.cs index 020c5cdbb..45bcb00f0 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1FieldElement.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP192R1Point.cs b/crypto/src/math/ec/custom/sec/SecP192R1Point.cs index 797a8de35..3b53e341e 100644 --- a/crypto/src/math/ec/custom/sec/SecP192R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP192R1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP192R1Point diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs index a55810c6d..98cf777a5 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP224K1Field diff --git a/crypto/src/math/ec/custom/sec/SecP224K1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP224K1FieldElement.cs index 72ff4b099..fec07436a 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1FieldElement.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Point.cs b/crypto/src/math/ec/custom/sec/SecP224K1Point.cs index 8cbd29699..98cb29274 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP224K1Point diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs index 559593c66..4f5c3bbda 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP224R1Field diff --git a/crypto/src/math/ec/custom/sec/SecP224R1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP224R1FieldElement.cs index 06f47cded..2b9a06564 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1FieldElement.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP224R1Point.cs b/crypto/src/math/ec/custom/sec/SecP224R1Point.cs index c3f4efb59..73c4f1948 100644 --- a/crypto/src/math/ec/custom/sec/SecP224R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP224R1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP224R1Point diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs index ba3a070a9..b0646e93f 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP256K1Field diff --git a/crypto/src/math/ec/custom/sec/SecP256K1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP256K1FieldElement.cs index d9a039a4f..473113d0f 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1FieldElement.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs index 3165682fa..072a0b969 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP256K1Point diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Field.cs b/crypto/src/math/ec/custom/sec/SecP256R1Field.cs index 9ed9dcd41..11594b2ba 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP256R1Field diff --git a/crypto/src/math/ec/custom/sec/SecP256R1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP256R1FieldElement.cs index b22763cfa..d7838aead 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1FieldElement.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs index 1de4a0b4a..83320824d 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP256R1Point diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Field.cs b/crypto/src/math/ec/custom/sec/SecP384R1Field.cs index 508b01e3c..7820775ee 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP384R1Field diff --git a/crypto/src/math/ec/custom/sec/SecP384R1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP384R1FieldElement.cs index 40086978d..18d48a57d 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1FieldElement.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP384R1Point.cs b/crypto/src/math/ec/custom/sec/SecP384R1Point.cs index 68c601611..83159ce61 100644 --- a/crypto/src/math/ec/custom/sec/SecP384R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP384R1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP384R1Point diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Field.cs b/crypto/src/math/ec/custom/sec/SecP521R1Field.cs index 3568156d8..b7f8eb146 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Field.cs @@ -1,6 +1,8 @@ using System; using System.Diagnostics; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP521R1Field diff --git a/crypto/src/math/ec/custom/sec/SecP521R1FieldElement.cs b/crypto/src/math/ec/custom/sec/SecP521R1FieldElement.cs index 83a615928..6f02a7eb5 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1FieldElement.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1FieldElement.cs @@ -1,5 +1,6 @@ using System; +using Org.BouncyCastle.Math.Raw; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Math.EC.Custom.Sec diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Point.cs b/crypto/src/math/ec/custom/sec/SecP521R1Point.cs index fb1996cfd..7ad97f76f 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Point.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Point.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Math.Raw; + namespace Org.BouncyCastle.Math.EC.Custom.Sec { internal class SecP521R1Point diff --git a/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs b/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs index dda778eea..1e7ddae91 100644 --- a/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs +++ b/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs @@ -15,23 +15,23 @@ namespace Org.BouncyCastle.Math.EC.Multiplier internal static readonly string PRECOMP_NAME = "bc_wtnaf"; /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by <code>k</code> using the reduced <code>τ</code>-adic NAF (RTNAF) * method. - * @param p The F2mPoint to multiply. + * @param p The AbstractF2mPoint to multiply. * @param k The integer by which to multiply <code>k</code>. * @return <code>p</code> multiplied by <code>k</code>. */ protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k) { - if (!(point is F2mPoint)) - throw new ArgumentException("Only F2mPoint can be used in WTauNafMultiplier"); - - F2mPoint p = (F2mPoint)point; - F2mCurve curve = (F2mCurve)p.Curve; - int m = curve.M; - sbyte a = (sbyte) curve.A.ToBigInteger().IntValue; - sbyte mu = curve.GetMu(); + 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); @@ -40,16 +40,16 @@ namespace Org.BouncyCastle.Math.EC.Multiplier } /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by an element <code>λ</code> of <code><b>Z</b>[τ]</code> using * the <code>τ</code>-adic NAF (TNAF) method. - * @param p The F2mPoint to multiply. + * @param p The AbstractF2mPoint to multiply. * @param lambda The element <code>λ</code> of * <code><b>Z</b>[τ]</code> of which to compute the * <code>[τ]</code>-adic NAF. * @return <code>p</code> multiplied by <code>λ</code>. */ - private F2mPoint MultiplyWTnaf(F2mPoint p, ZTauElement lambda, + private AbstractF2mPoint MultiplyWTnaf(AbstractF2mPoint p, ZTauElement lambda, PreCompInfo preCompInfo, sbyte a, sbyte mu) { ZTauElement[] alpha = (a == 0) ? Tnaf.Alpha0 : Tnaf.Alpha1; @@ -63,20 +63,20 @@ namespace Org.BouncyCastle.Math.EC.Multiplier } /** - * Multiplies a {@link org.bouncycastle.math.ec.F2mPoint F2mPoint} + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} * by an element <code>λ</code> of <code><b>Z</b>[τ]</code> * using the window <code>τ</code>-adic NAF (TNAF) method, given the * WTNAF of <code>λ</code>. - * @param p The F2mPoint to multiply. + * @param p The AbstractF2mPoint to multiply. * @param u The the WTNAF of <code>λ</code>.. * @return <code>λ * p</code> */ - private static F2mPoint MultiplyFromWTnaf(F2mPoint p, sbyte[] u, PreCompInfo preCompInfo) + private static AbstractF2mPoint MultiplyFromWTnaf(AbstractF2mPoint p, sbyte[] u, PreCompInfo preCompInfo) { - F2mCurve curve = (F2mCurve)p.Curve; + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; sbyte a = (sbyte)curve.A.ToBigInteger().IntValue; - F2mPoint[] pu; + AbstractF2mPoint[] pu; if ((preCompInfo == null) || !(preCompInfo is WTauNafPreCompInfo)) { pu = Tnaf.GetPreComp(p, a); @@ -90,26 +90,35 @@ namespace Org.BouncyCastle.Math.EC.Multiplier pu = ((WTauNafPreCompInfo)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 - F2mPoint q = (F2mPoint)curve.Infinity; + AbstractF2mPoint q = (AbstractF2mPoint) p.Curve.Infinity; + + int tauCount = 0; for (int i = u.Length - 1; i >= 0; i--) { - q = Tnaf.Tau(q); - sbyte ui = u[i]; + ++tauCount; + int ui = u[i]; if (ui != 0) { - if (ui > 0) - { - q = q.AddSimple(pu[ui]); - } - else - { - // u[i] < 0 - q = q.SubtractSimple(pu[-ui]); - } + 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; } } diff --git a/crypto/src/math/ec/multiplier/WTauNafPreCompInfo.cs b/crypto/src/math/ec/multiplier/WTauNafPreCompInfo.cs index 3c18404c0..72659b3ec 100644 --- a/crypto/src/math/ec/multiplier/WTauNafPreCompInfo.cs +++ b/crypto/src/math/ec/multiplier/WTauNafPreCompInfo.cs @@ -8,14 +8,14 @@ namespace Org.BouncyCastle.Math.EC.Multiplier : PreCompInfo { /** - * Array holding the precomputed <code>F2mPoint</code>s used for the + * Array holding the precomputed <code>AbstractF2mPoint</code>s used for the * WTNAF multiplication in <code> * {@link org.bouncycastle.math.ec.multiplier.WTauNafMultiplier.multiply() * WTauNafMultiplier.multiply()}</code>. */ - protected F2mPoint[] m_preComp; + protected AbstractF2mPoint[] m_preComp; - public virtual F2mPoint[] PreComp + public virtual AbstractF2mPoint[] PreComp { get { return m_preComp; } set { this.m_preComp = value; } diff --git a/crypto/src/math/raw/Interleave.cs b/crypto/src/math/raw/Interleave.cs new file mode 100644 index 000000000..9755c9d6f --- /dev/null +++ b/crypto/src/math/raw/Interleave.cs @@ -0,0 +1,70 @@ +using System; + +namespace Org.BouncyCastle.Math.Raw +{ + internal abstract class Interleave + { + /* + * 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) + { + return INTERLEAVE2_TABLE[x & 0xFF]; + } + + internal static uint Expand16to32(uint x) + { + return (uint)(INTERLEAVE2_TABLE[x & 0xFF] | INTERLEAVE2_TABLE[(x >> 8) & 0xFF] << 16); + } + + internal static ulong Expand32to64(uint x) + { + uint r00 = (uint)(INTERLEAVE2_TABLE[x & 0xFF] | INTERLEAVE2_TABLE[(x >> 8) & 0xFF] << 16); + uint r32 = (uint)(INTERLEAVE2_TABLE[(x >> 16) & 0xFF] | INTERLEAVE2_TABLE[x >> 24] << 16); + return (ulong)r32 << 32 | (ulong)r00; + } + + internal static void Expand64To128(ulong x, ulong[] z, int zOff) + { + z[zOff ] = Expand32to64((uint)x); + z[zOff + 1] = Expand32to64((uint)(x >> 32)); + } + } +} diff --git a/crypto/src/math/ec/Mod.cs b/crypto/src/math/raw/Mod.cs index 80534ca9f..63467e668 100644 --- a/crypto/src/math/ec/Mod.cs +++ b/crypto/src/math/raw/Mod.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; using Org.BouncyCastle.Utilities; -namespace Org.BouncyCastle.Math.EC +namespace Org.BouncyCastle.Math.Raw { internal abstract class Mod { diff --git a/crypto/src/math/ec/Nat.cs b/crypto/src/math/raw/Nat.cs index 17b632f26..1f9ab00ec 100644 --- a/crypto/src/math/ec/Nat.cs +++ b/crypto/src/math/raw/Nat.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; -namespace Org.BouncyCastle.Math.EC +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat { @@ -212,6 +212,11 @@ namespace Org.BouncyCastle.Math.EC 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) @@ -666,6 +671,17 @@ namespace Org.BouncyCastle.Math.EC 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); @@ -690,6 +706,18 @@ namespace Org.BouncyCastle.Math.EC 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); @@ -714,6 +742,18 @@ namespace Org.BouncyCastle.Math.EC 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; diff --git a/crypto/src/math/raw/Nat128.cs b/crypto/src/math/raw/Nat128.cs new file mode 100644 index 000000000..819c52062 --- /dev/null +++ b/crypto/src/math/raw/Nat128.cs @@ -0,0 +1,856 @@ +using System; +using System.Diagnostics; + +using Org.BouncyCastle.Crypto.Utilities; + +namespace 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 Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[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]; + ulong zz_6 = zz[6]; + { + 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]; + ulong zz_6 = zz[zzOff + 6]; + { + 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; + } + } +} diff --git a/crypto/src/math/raw/Nat160.cs b/crypto/src/math/raw/Nat160.cs new file mode 100644 index 000000000..153ac0a43 --- /dev/null +++ b/crypto/src/math/raw/Nat160.cs @@ -0,0 +1,874 @@ +using System; +using System.Diagnostics; + +using Org.BouncyCastle.Crypto.Utilities; + +namespace 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 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]; + ulong zz_6 = zz[6]; + { + 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]; + ulong zz_8 = zz[8]; + { + 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]; + ulong zz_6 = zz[zzOff + 6]; + { + 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]; + ulong zz_8 = zz[zzOff + 8]; + { + 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; + } + } +} diff --git a/crypto/src/math/ec/custom/sec/Nat192.cs b/crypto/src/math/raw/Nat192.cs index 94d7ed17c..4797609ee 100644 --- a/crypto/src/math/ec/custom/sec/Nat192.cs +++ b/crypto/src/math/raw/Nat192.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; -namespace Org.BouncyCastle.Math.EC.Custom.Sec +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat192 { @@ -145,16 +145,33 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec z[5] = x[5]; } + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[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); @@ -179,6 +196,18 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -194,6 +223,21 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -251,6 +295,22 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -263,6 +323,18 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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]; @@ -949,6 +1021,20 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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; diff --git a/crypto/src/math/ec/custom/sec/Nat224.cs b/crypto/src/math/raw/Nat224.cs index d5b916a54..940e930ac 100644 --- a/crypto/src/math/ec/custom/sec/Nat224.cs +++ b/crypto/src/math/raw/Nat224.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; -namespace Org.BouncyCastle.Math.EC.Custom.Sec +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat224 { diff --git a/crypto/src/math/ec/custom/sec/Nat256.cs b/crypto/src/math/raw/Nat256.cs index bd2d6da47..19455031a 100644 --- a/crypto/src/math/ec/custom/sec/Nat256.cs +++ b/crypto/src/math/raw/Nat256.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; -namespace Org.BouncyCastle.Math.EC.Custom.Sec +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat256 { @@ -239,16 +239,34 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec z[7] = x[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 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); @@ -273,6 +291,18 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -288,6 +318,21 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -345,6 +390,22 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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) @@ -357,6 +418,18 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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]; @@ -1285,6 +1358,20 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec 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; diff --git a/crypto/src/math/raw/Nat320.cs b/crypto/src/math/raw/Nat320.cs new file mode 100644 index 000000000..c7daa71e2 --- /dev/null +++ b/crypto/src/math/raw/Nat320.cs @@ -0,0 +1,98 @@ +using System; +using System.Diagnostics; + +using Org.BouncyCastle.Crypto.Utilities; + +namespace 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 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); + } + } +} diff --git a/crypto/src/math/ec/custom/sec/Nat384.cs b/crypto/src/math/raw/Nat384.cs index dd93e68b6..ed1c47e8c 100644 --- a/crypto/src/math/ec/custom/sec/Nat384.cs +++ b/crypto/src/math/raw/Nat384.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; -namespace Org.BouncyCastle.Math.EC.Custom.Sec +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat384 { diff --git a/crypto/src/math/raw/Nat448.cs b/crypto/src/math/raw/Nat448.cs new file mode 100644 index 000000000..52a253f1b --- /dev/null +++ b/crypto/src/math/raw/Nat448.cs @@ -0,0 +1,100 @@ +using System; +using System.Diagnostics; + +using Org.BouncyCastle.Crypto.Utilities; + +namespace 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 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); + } + } +} diff --git a/crypto/src/math/ec/custom/sec/Nat512.cs b/crypto/src/math/raw/Nat512.cs index 46e10f995..a9ef2b3b6 100644 --- a/crypto/src/math/ec/custom/sec/Nat512.cs +++ b/crypto/src/math/raw/Nat512.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; -namespace Org.BouncyCastle.Math.EC.Custom.Sec +namespace Org.BouncyCastle.Math.Raw { internal abstract class Nat512 { diff --git a/crypto/src/math/raw/Nat576.cs b/crypto/src/math/raw/Nat576.cs new file mode 100644 index 000000000..813fb86be --- /dev/null +++ b/crypto/src/math/raw/Nat576.cs @@ -0,0 +1,102 @@ +using System; +using System.Diagnostics; + +using Org.BouncyCastle.Crypto.Utilities; + +namespace 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 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); + } + } +} |