diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-11 21:10:07 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-11 21:10:07 +0700 |
commit | 3046d8145e0cb90496c011f8144dd0910afa84c0 (patch) | |
tree | eb8c6fca392c19e31e31cda48e9b50b89c89769e /crypto/test | |
parent | Hardware-accelerate Haraka engine for SPHINCS+ (diff) | |
download | BouncyCastle.NET-ed25519-3046d8145e0cb90496c011f8144dd0910afa84c0.tar.xz |
Change method names in IXof
- distinct from IDigest methods and consistent with span-based methods
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/src/crypto/test/Blake2xsDigestTest.cs | 8 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/Blake3Test.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/CSHAKETest.cs | 34 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/KMACTest.cs | 32 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/ParallelHashTest.cs | 6 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/ShakeDigestTest.cs | 16 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/TupleHashTest.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/math/ec/rfc8032/test/Ed448Test.cs | 4 | ||||
-rw-r--r-- | crypto/test/src/test/ParallelHashTest.cs | 6 | ||||
-rw-r--r-- | crypto/test/src/test/TupleHashTest.cs | 4 |
10 files changed, 59 insertions, 59 deletions
diff --git a/crypto/test/src/crypto/test/Blake2xsDigestTest.cs b/crypto/test/src/crypto/test/Blake2xsDigestTest.cs index 3cea10a38..0a8e9c1fa 100644 --- a/crypto/test/src/crypto/test/Blake2xsDigestTest.cs +++ b/crypto/test/src/crypto/test/Blake2xsDigestTest.cs @@ -2609,7 +2609,7 @@ namespace Org.BouncyCastle.Crypto.Tests h.BlockUpdate(input, 0, input.Length); Blake2xsDigest clone = new Blake2xsDigest(h); - h.DoOutput(output, outOff, digestSize); + h.Output(output, outOff, digestSize); if (!AreEqual(output, outOff, outOff + digestSize, expected, 0, digestSize)) { Fail("BLAKE2xs mismatch on test vector after a reset", XofTestVectors[i, 2], @@ -2617,7 +2617,7 @@ namespace Org.BouncyCastle.Crypto.Tests } byte[] outClone = new byte[digestSize]; - clone.DoFinal(outClone, 0, outClone.Length); + clone.OutputFinal(outClone, 0, outClone.Length); if (!AreEqual(outClone, expected)) { Fail("BLAKE2xs mismatch on test vector against a clone", XofTestVectors[i, 2], @@ -2646,7 +2646,7 @@ namespace Org.BouncyCastle.Crypto.Tests try { - h.DoFinal(output, 0, output.Length); + h.OutputFinal(output, 0, output.Length); Fail("no exception"); } catch (ArgumentException e) @@ -2654,7 +2654,7 @@ namespace Org.BouncyCastle.Crypto.Tests IsEquals("Output length is above the digest length", e.Message); } - h.DoFinal(output, 0, 1); + h.OutputFinal(output, 0, 1); } //private void TestBlake2xsUnknownLength() diff --git a/crypto/test/src/crypto/test/Blake3Test.cs b/crypto/test/src/crypto/test/Blake3Test.cs index 648663ac7..d563a86c8 100644 --- a/crypto/test/src/crypto/test/Blake3Test.cs +++ b/crypto/test/src/crypto/test/Blake3Test.cs @@ -395,7 +395,7 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] myAlt = new byte[myLen]; /* Perform standard output */ - pDigest.DoOutput(pBuffer, 0, myLen); + pDigest.Output(pBuffer, 0, myLen); pDigest.Reset(mySave); /* Loop creating output 5 bytes at a time */ @@ -403,7 +403,7 @@ namespace Org.BouncyCastle.Crypto.Tests { /* Output bytes */ int myRead = System.Math.Min(PARTOUT, myLen - i); - pDigest.DoOutput(myAlt, i, myRead); + pDigest.Output(myAlt, i, myRead); /* Around halfway through */ if (i == PARTBREAK) diff --git a/crypto/test/src/crypto/test/CSHAKETest.cs b/crypto/test/src/crypto/test/CSHAKETest.cs index 581832aaf..fa362e21b 100644 --- a/crypto/test/src/crypto/test/CSHAKETest.cs +++ b/crypto/test/src/crypto/test/CSHAKETest.cs @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res = new byte[32]; - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("c1c36925b6409a04f1b504fcbca9d82b4017277cb5ed2b2065fc1d3814d5aaf5"), res)); @@ -49,7 +49,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[32]; - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("C5221D50E4F822D96A2E8881A961420F294B7B24FE3D2094BAED2C6524CC166B "), res)); @@ -59,7 +59,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode( "D008828E2B80AC9D2218FFEE1D070C48" + @@ -86,7 +86,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode( "07DC27B11E51FBAC75BC7B3C1D983E8B" + @@ -113,15 +113,15 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] buf = new byte[20]; CShakeDigest cshake1 = new CShakeDigest(256, new byte[0], new byte[265]); - cshake1.DoOutput(buf, 0, buf.Length); + cshake1.Output(buf, 0, buf.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("6e393540387004f087c4180db008acf6825190cf"), buf)); CShakeDigest cshake2 = new CShakeDigest(128, new byte[0], new byte[329]); - cshake2.DoOutput(buf, 0, buf.Length); + cshake2.Output(buf, 0, buf.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("309bd7c285fcf8b839c9686b2cc00bd578947bee"), buf)); cshake2 = new CShakeDigest(128, new byte[29], new byte[300]); - cshake2.DoOutput(buf, 0, buf.Length); + cshake2.Output(buf, 0, buf.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("ff6aafd83b8d22fc3e2e9b9948b581967ed9c5e7"), buf)); } @@ -133,19 +133,19 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res = new byte[32]; - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("c1c36925b6409a04f1b504fcbca9d82b4017277cb5ed2b2065fc1d3814d5aaf5"), res)); - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(!Arrays.AreEqual(Hex.Decode("c1c36925b6409a04f1b504fcbca9d82b4017277cb5ed2b2065fc1d3814d5aaf5"), res)); - cshake.DoFinal(res, 0, res.Length); + cshake.OutputFinal(res, 0, res.Length); cshake.BlockUpdate(Hex.Decode("00010203"), 0, 4); - cshake.DoFinal(res, 0, res.Length); + cshake.OutputFinal(res, 0, res.Length); string s = Hex.ToHexString(res); @@ -155,11 +155,11 @@ namespace Org.BouncyCastle.Crypto.Tests cshake.BlockUpdate(Hex.Decode("00010203"), 0, 4); - cshake.DoOutput(res, 0, res.Length); + cshake.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("c1c36925b6409a04f1b504fcbca9d82b4017277cb5ed2b2065fc1d3814d5aaf5"), res)); - cshake.DoFinal(res, 0, res.Length); + cshake.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("9cbce830079c452abdeb875366a49ebfe75b89ef17396e34898e904830b0e136"), res)); } @@ -181,14 +181,14 @@ namespace Org.BouncyCastle.Crypto.Tests cshake_.BlockUpdate(hex0123, 0, 4); - cshake_.DoFinal(res, 0, 16); + cshake_.OutputFinal(res, 0, 16); } CShakeDigest cshake = new CShakeDigest(256, new byte[0], new byte[200]); cshake.BlockUpdate(data, 0, 200); - cshake.DoFinal(res, 0, 32); + cshake.OutputFinal(res, 0, 32); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("4a899b5be460d85a9789215bc17f88b8f8ac049bd3b519f561e7b5d3870dafa3"), res)); } @@ -204,8 +204,8 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res1 = new byte[32]; byte[] res2 = new byte[32]; - ref_.DoFinal(res1, 0, res1.Length); - cshake.DoFinal(res2, 0, res2.Length); + ref_.OutputFinal(res1, 0, res1.Length); + cshake.OutputFinal(res2, 0, res2.Length); Assert.IsTrue(Arrays.AreEqual(res1, res2)); } diff --git a/crypto/test/src/crypto/test/KMACTest.cs b/crypto/test/src/crypto/test/KMACTest.cs index b726f37bf..9a67b5a69 100644 --- a/crypto/test/src/crypto/test/KMACTest.cs +++ b/crypto/test/src/crypto/test/KMACTest.cs @@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res = new byte[32]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue( Arrays.AreEqual(Hex.Decode("E5780B0D3EA6F7D3A429C5706AA43A00FADBD7D49628839E3187243F456EE14E"), res), "oops: " + Hex.ToHexString(res)); @@ -46,7 +46,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[32]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue( Arrays.AreEqual(Hex.Decode("3B1FBA963CD8B0B59E8C1A6D71888B7143651AF8BA0A7070C0979E2811324AA5"), res), "oops: " + Hex.ToHexString(res)); @@ -67,7 +67,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[32]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("1F5B4E6CCA02209E0DCB5CA635B89A15E271ECC760071DFD805FAA38F9729230"), res), "oops:" + Hex.ToHexString(res)); @@ -82,7 +82,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("20C570C31346F703C9AC36C61C03CB64C3970D0CFC787E9B79599D273A68D2F7F69D4CC3DE9D104A351689F27CF6F5951F0103F33F4F24871024D9C27773A8DD"), res), "oops:" + Hex.ToHexString(res)); @@ -103,7 +103,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("75358CF39E41494E949707927CEE0AF20A3FF553904C86B08F21CC414BCFD691589D27CF5E15369CBBFF8B9A4C2EB17800855D0235FF635DA82533EC6B759B69"), res), "oops:" + Hex.ToHexString(res)); @@ -124,7 +124,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("B58618F71F92E1D56C1B8C55DDD7CD188B97B4CA4D99831EB2699A837DA2E4D970FBACFDE50033AEA585F1A2708510C32D07880801BD182898FE476876FC8965"), res), "oops:" + Hex.ToHexString(res)); @@ -151,29 +151,29 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res = new byte[32]; - kmac.DoOutput(res, 0, res.Length); + kmac.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("31a44527b4ed9f5c6101d11de6d26f0620aa5c341def41299657fe9df1a3b16c"), res), Hex.ToHexString(res)); - kmac.DoOutput(res, 0, res.Length); + kmac.Output(res, 0, res.Length); Assert.IsTrue(!Arrays.AreEqual(Hex.Decode("31a44527b4ed9f5c6101d11de6d26f0620aa5c341def41299657fe9df1a3b16c"), res)); - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); kmac.BlockUpdate(Hex.Decode("00010203"), 0, 4); - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("3B1FBA963CD8B0B59E8C1A6D71888B7143651AF8BA0A7070C0979E2811324AA5"), res)); kmac.BlockUpdate(Hex.Decode("00010203"), 0, 4); - kmac.DoOutput(res, 0, res.Length); + kmac.Output(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("31a44527b4ed9f5c6101d11de6d26f0620aa5c341def41299657fe9df1a3b16c"), res)); - kmac.DoFinal(res, 0, res.Length); + kmac.OutputFinal(res, 0, res.Length); Assert.IsTrue(Arrays.AreEqual(Hex.Decode("ffcb48c7620ccd67d1c83224186892cef2f2a99278d5cfdde10e48bdc89718c2"), res), Hex.ToHexString(res)); } @@ -218,14 +218,14 @@ namespace Org.BouncyCastle.Crypto.Tests KMac k128 = new KMac(128, new byte[0]); k128.Init(new KeyParameter(new byte[163])); k128.BlockUpdate(data, 0, data.Length); - k128.DoOutput(out_, 0, out_.Length); + k128.Output(out_, 0, out_.Length); Assert.IsTrue( Arrays.AreEqual(out_, Hex.Decode("6e6ab56468c7445f81c679f89f45c90a95a9c01afbaab5f7065b7e2e96f7d2bb")),"128 failed"); KMac k256 = new KMac(256, new byte[0]); k256.Init(new KeyParameter(new byte[131])); k256.BlockUpdate(data, 0, data.Length); - k256.DoOutput(out_, 0, out_.Length); + k256.Output(out_, 0, out_.Length); Assert.IsTrue(Arrays.AreEqual(out_, Hex.Decode("f6302d4f854b4872e811b37993b6bfe027258089b6a9fbb26a755b1ebfc0d830")), "256 failed"); } @@ -243,8 +243,8 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res1 = new byte[32]; byte[] res2 = new byte[32]; - ref_.DoFinal(res1, 0, res1.Length); - kmac.DoFinal(res2, 0, res2.Length); + ref_.OutputFinal(res1, 0, res1.Length); + kmac.OutputFinal(res2, 0, res2.Length); Assert.IsTrue(Arrays.AreEqual(res1, res2)); } diff --git a/crypto/test/src/crypto/test/ParallelHashTest.cs b/crypto/test/src/crypto/test/ParallelHashTest.cs index e37516366..b7c4de1a1 100644 --- a/crypto/test/src/crypto/test/ParallelHashTest.cs +++ b/crypto/test/src/crypto/test/ParallelHashTest.cs @@ -101,7 +101,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[32]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("F7 FD 53 12 89 6C 66 85 C8 28 AF 7E 2A DB 97 E3 93 E7 F8 D5 4E 3C 2E A4 B9 5E 5A CA 37 96 E8 FC"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("0127ad9772ab904691987fcc4a24888f341fa0db2145e872d4efd255376602f0"), res)); @@ -113,7 +113,7 @@ namespace Org.BouncyCastle.Crypto.Tests res = new byte[64]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("69 D0 FC B7 64 EA 05 5D D0 93 34 BC 60 21 CB 7E 4B 61 34 8D FF 37 5D A2 62 67 1C DE C3 EF FA 8D 1B 45 68 A6 CC E1 6B 1C AD 94 6D DD E2 7F 6C E2 B8 DE E4 CD 1B 24 85 1E BF 00 EB 90 D4 38 13 E9"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("6b3e790b330c889a204c2fbc728d809f19367328d852f4002dc829f73afd6bcefb7fe5b607b13a801c0be5c1170bdb794e339458fdb0e62a6af3d42558970249"), res)); @@ -134,7 +134,7 @@ namespace Org.BouncyCastle.Crypto.Tests byte[] res = new byte[16 / 8]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue(Arrays.AreEqual(Hex.Decode("13C4"), res)); } diff --git a/crypto/test/src/crypto/test/ShakeDigestTest.cs b/crypto/test/src/crypto/test/ShakeDigestTest.cs index 0aeedb256..dd160fcbd 100644 --- a/crypto/test/src/crypto/test/ShakeDigestTest.cs +++ b/crypto/test/src/crypto/test/ShakeDigestTest.cs @@ -26,9 +26,9 @@ namespace Org.BouncyCastle.Crypto.Tests { } - internal int MyDoFinal(byte[] output, int outOff, int outLen, byte partialByte, int partialBits) + internal int MyOutputFinal(byte[] output, int outOff, int outLen, byte partialByte, int partialBits) { - return DoFinal(output, outOff, outLen, partialByte, partialBits); + return OutputFinal(output, outOff, outLen, partialByte, partialBits); } } @@ -187,12 +187,12 @@ namespace Org.BouncyCastle.Crypto.Tests if (partialBits == 0) { d.BlockUpdate(m, 0, m.Length); - d.DoFinal(output, 0, outLen); + d.OutputFinal(output, 0, outLen); } else { d.BlockUpdate(m, 0, m.Length - 1); - d.MyDoFinal(output, 0, outLen, m[m.Length - 1], partialBits); + d.MyOutputFinal(output, 0, outLen, m[m.Length - 1], partialBits); } if (!Arrays.AreEqual(expected, output)) @@ -209,8 +209,8 @@ namespace Org.BouncyCastle.Crypto.Tests m = v.Message; d.BlockUpdate(m, 0, m.Length); - d.DoOutput(output, 0, outLen / 2); - d.DoOutput(output, outLen / 2, output.Length - outLen / 2); + d.Output(output, 0, outLen / 2); + d.Output(output, outLen / 2, output.Length - outLen / 2); if (!Arrays.AreEqual(expected, output)) { @@ -235,8 +235,8 @@ namespace Org.BouncyCastle.Crypto.Tests m = v.Message; d.BlockUpdate(m, 0, m.Length); - d.DoOutput(output, 0, outLen / 2); - d.DoFinal(output, outLen / 2, output.Length - outLen / 2); + d.Output(output, 0, outLen / 2); + d.OutputFinal(output, outLen / 2, output.Length - outLen / 2); if (!Arrays.AreEqual(expected, output)) { diff --git a/crypto/test/src/crypto/test/TupleHashTest.cs b/crypto/test/src/crypto/test/TupleHashTest.cs index 918fcbea4..8eaa97e5c 100644 --- a/crypto/test/src/crypto/test/TupleHashTest.cs +++ b/crypto/test/src/crypto/test/TupleHashTest.cs @@ -88,7 +88,7 @@ namespace Org.BouncyCastle.Crypto.Tests tHash.BlockUpdate(Hex.Decode("202122232425262728"), 0, 9); res = new byte[32]; - tHash.DoOutput(res, 0, res.Length); + tHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("E6 0F 20 2C 89 A2 63 1E DA 8D 4C 58 8C A5 FD 07 F3 9E 51 51 99 8D EC CF 97 3A DB 38 04 BB 6E 84"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("900fe16cad098d28e74d632ed852f99daab7f7df4d99e775657885b4bf76d6f8"), res)); @@ -100,7 +100,7 @@ namespace Org.BouncyCastle.Crypto.Tests tHash.BlockUpdate(Hex.Decode("202122232425262728"), 0, 9); res = new byte[64]; - tHash.DoOutput(res, 0, res.Length); + tHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("45 00 0B E6 3F 9B 6B FD 89 F5 47 17 67 0F 69 A9 BC 76 35 91 A4 F0 5C 50 D6 88 91 A7 44 BC C6 E7 D6 D5 B5 E8 2C 01 8D A9 99 ED 35 B0 BB 49 C9 67 8E 52 6A BD 8E 85 C1 3E D2 54 02 1D B9 E7 90 CE"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("0c59b11464f2336c34663ed51b2b950bec743610856f36c28d1d088d8a2446284dd09830a6a178dc752376199fae935d86cfdee5913d4922dfd369b66a53c897"), res)); diff --git a/crypto/test/src/math/ec/rfc8032/test/Ed448Test.cs b/crypto/test/src/math/ec/rfc8032/test/Ed448Test.cs index 40d28cc97..2cfc57016 100644 --- a/crypto/test/src/math/ec/rfc8032/test/Ed448Test.cs +++ b/crypto/test/src/math/ec/rfc8032/test/Ed448Test.cs @@ -81,7 +81,7 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032.Tests IXof prehash = Ed448.CreatePrehash(); prehash.BlockUpdate(m, 0, mLen); - prehash.DoFinal(ph, 0, ph.Length); + prehash.OutputFinal(ph, 0, ph.Length); Ed448.SignPrehash(sk, 0, ctx, ph, 0, sig1, 0); Ed448.SignPrehash(sk, 0, pk, 0, ctx, ph, 0, sig2, 0); @@ -607,7 +607,7 @@ namespace Org.BouncyCastle.Math.EC.Rfc8032.Tests prehash.BlockUpdate(m, 0, m.Length); byte[] ph = new byte[Ed448.PrehashSize]; - prehash.DoFinal(ph, 0, ph.Length); + prehash.OutputFinal(ph, 0, ph.Length); Ed448.SignPrehash(sk, 0, ctx, ph, 0, sigGen, 0); Assert.IsTrue(Arrays.AreEqual(sig, sigGen), text); diff --git a/crypto/test/src/test/ParallelHashTest.cs b/crypto/test/src/test/ParallelHashTest.cs index 2c8cac637..afb6ccfe0 100644 --- a/crypto/test/src/test/ParallelHashTest.cs +++ b/crypto/test/src/test/ParallelHashTest.cs @@ -102,7 +102,7 @@ public class ParallelHashTest res = new byte[32]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("F7 FD 53 12 89 6C 66 85 C8 28 AF 7E 2A DB 97 E3 93 E7 F8 D5 4E 3C 2E A4 B9 5E 5A CA 37 96 E8 FC"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("0127ad9772ab904691987fcc4a24888f341fa0db2145e872d4efd255376602f0"), res)); @@ -114,7 +114,7 @@ public class ParallelHashTest res = new byte[64]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("69 D0 FC B7 64 EA 05 5D D0 93 34 BC 60 21 CB 7E 4B 61 34 8D FF 37 5D A2 62 67 1C DE C3 EF FA 8D 1B 45 68 A6 CC E1 6B 1C AD 94 6D DD E2 7F 6C E2 B8 DE E4 CD 1B 24 85 1E BF 00 EB 90 D4 38 13 E9"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("6b3e790b330c889a204c2fbc728d809f19367328d852f4002dc829f73afd6bcefb7fe5b607b13a801c0be5c1170bdb794e339458fdb0e62a6af3d42558970249"), res)); @@ -132,7 +132,7 @@ public class ParallelHashTest byte[] res = new byte[16 / 8]; - pHash.DoOutput(res, 0, res.Length); + pHash.Output(res, 0, res.Length); IsTrue(Arrays.AreEqual(Hex.Decode("13C4"), res)); } diff --git a/crypto/test/src/test/TupleHashTest.cs b/crypto/test/src/test/TupleHashTest.cs index 4d92ee7fe..deb8f72cf 100644 --- a/crypto/test/src/test/TupleHashTest.cs +++ b/crypto/test/src/test/TupleHashTest.cs @@ -87,7 +87,7 @@ public class TupleHashTest tHash.BlockUpdate(Hex.Decode("202122232425262728"), 0, 9); res = new byte[32]; - tHash.DoOutput(res, 0, res.Length); + tHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("E6 0F 20 2C 89 A2 63 1E DA 8D 4C 58 8C A5 FD 07 F3 9E 51 51 99 8D EC CF 97 3A DB 38 04 BB 6E 84"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("900fe16cad098d28e74d632ed852f99daab7f7df4d99e775657885b4bf76d6f8"), res)); @@ -99,7 +99,7 @@ public class TupleHashTest tHash.BlockUpdate(Hex.Decode("202122232425262728"), 0, 9); res = new byte[64]; - tHash.DoOutput(res, 0, res.Length); + tHash.Output(res, 0, res.Length); IsTrue("oops!", !Arrays.AreEqual(Hex.Decode("45 00 0B E6 3F 9B 6B FD 89 F5 47 17 67 0F 69 A9 BC 76 35 91 A4 F0 5C 50 D6 88 91 A7 44 BC C6 E7 D6 D5 B5 E8 2C 01 8D A9 99 ED 35 B0 BB 49 C9 67 8E 52 6A BD 8E 85 C1 3E D2 54 02 1D B9 E7 90 CE"), res)); IsTrue("oops!", Arrays.AreEqual(Hex.Decode("0c59b11464f2336c34663ed51b2b950bec743610856f36c28d1d088d8a2446284dd09830a6a178dc752376199fae935d86cfdee5913d4922dfd369b66a53c897"), res)); |