Skip to content

Commit

Permalink
[Tests] Use collection expressions (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon committed Jan 16, 2024
1 parent 2da781c commit e66fda8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Test/Attestation/Tpm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1740,11 +1740,12 @@ public async Task TestTPMPubAreaUniqueCurveMismatch()

_credentialPublicKey = new CredentialPublicKey(cpk);

unique = GetUInt16BigEndianBytes(x.Length)
.Concat(x)
.Concat(GetUInt16BigEndianBytes(y.Length))
.Concat(y)
.ToArray();
unique = [
.. GetUInt16BigEndianBytes(x.Length),
.. x,
.. GetUInt16BigEndianBytes(y.Length),
.. y
];

curveId = BitConverter.GetBytes((ushort)CoseCurveToTpm[2]).Reverse().ToArray();
kdf = BitConverter.GetBytes((ushort)TpmAlg.TPM_ALG_NULL);
Expand Down
2 changes: 1 addition & 1 deletion Test/Extensions/SignatureHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static byte[] EcDsaSigFromSig(ReadOnlySpan<byte> sig, int keySizeInBits)

var writer = new AsnWriter(AsnEncodingRules.BER);

ReadOnlySpan<byte> zero = new byte[1] { 0 };
ReadOnlySpan<byte> zero = [0];

using (writer.PushSequence())
{
Expand Down

0 comments on commit e66fda8

Please sign in to comment.