From d438290428230551ff568329478b0e45e5085b44 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 20 Sep 2022 15:19:15 +0700 Subject: Give IStreamCalculator a generic type --- crypto/test/src/tsp/test/NewTspTest.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crypto/test') diff --git a/crypto/test/src/tsp/test/NewTspTest.cs b/crypto/test/src/tsp/test/NewTspTest.cs index 01dbc0e13..c98e5d191 100644 --- a/crypto/test/src/tsp/test/NewTspTest.cs +++ b/crypto/test/src/tsp/test/NewTspTest.cs @@ -642,27 +642,27 @@ namespace Org.BouncyCastle.Tsp.Tests { Asn1DigestFactory digCalc = Asn1DigestFactory.Get(OiwObjectIdentifiers.IdSha1); - IStreamCalculator calc = digCalc.CreateCalculator(); + var calc = digCalc.CreateCalculator(); using (Stream s = calc.Stream) { byte[] crt = cert.GetEncoded(); s.Write(crt, 0, crt.Length); } - certHash = ((SimpleBlockResult)calc.GetResult()).Collect(); + certHash = calc.GetResult().Collect(); } { Asn1DigestFactory digCalc = Asn1DigestFactory.Get(NistObjectIdentifiers.IdSha256); - IStreamCalculator calc = digCalc.CreateCalculator(); + var calc = digCalc.CreateCalculator(); using (Stream s = calc.Stream) { byte[] crt = cert.GetEncoded(); s.Write(crt, 0, crt.Length); } - certHash256 = ((SimpleBlockResult)calc.GetResult()).Collect(); + certHash256 = calc.GetResult().Collect(); } @@ -772,14 +772,14 @@ namespace Org.BouncyCastle.Tsp.Tests Assert.NotNull(table[PkcsObjectIdentifiers.IdAASigningCertificateV2]); Asn1DigestFactory digCalc = Asn1DigestFactory.Get(NistObjectIdentifiers.IdSha256); - IStreamCalculator calc = digCalc.CreateCalculator(); + var calc = digCalc.CreateCalculator(); using (Stream s = calc.Stream) { byte[] crt = cert.GetEncoded(); s.Write(crt, 0, crt.Length); } - byte[] certHash = ((SimpleBlockResult)calc.GetResult()).Collect(); + byte[] certHash = calc.GetResult().Collect(); SigningCertificateV2 sigCertV2 = SigningCertificateV2.GetInstance(table[PkcsObjectIdentifiers.IdAASigningCertificateV2].AttrValues[0]); -- cgit 1.5.1