@@ -45,8 +45,8 @@ public void Protect_EncryptsToDefaultProtector_MultiplePurposes()
45
45
. Setup ( o => o . Encrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
46
46
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualPlaintext , actualAad ) =>
47
47
{
48
- Assert . Equal ( expectedPlaintext . AsSpan ( ) , actualPlaintext ) ;
49
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
48
+ Assert . Equal ( expectedPlaintext , actualPlaintext . AsSpan ( ) ) ;
49
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
50
50
return new byte [ ] { 0x23 , 0x29 , 0x31 , 0x37 } ; // ciphertext + tag
51
51
} ) ;
52
52
@@ -83,8 +83,8 @@ public void Protect_EncryptsToDefaultProtector_SinglePurpose()
83
83
. Setup ( o => o . Encrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
84
84
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualPlaintext , actualAad ) =>
85
85
{
86
- Assert . Equal ( expectedPlaintext . AsSpan ( ) , actualPlaintext ) ;
87
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
86
+ Assert . Equal ( expectedPlaintext , actualPlaintext . AsSpan ( ) ) ;
87
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
88
88
return new byte [ ] { 0x23 , 0x29 , 0x31 , 0x37 } ; // ciphertext + tag
89
89
} ) ;
90
90
@@ -423,8 +423,8 @@ public void Unprotect_KeyRevoked_RevocationAllowed_ReturnsOriginalData_SetsRevok
423
423
. Setup ( o => o . Decrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
424
424
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualCiphertext , actualAad ) =>
425
425
{
426
- Assert . Equal ( expectedCiphertext . AsSpan ( ) , actualCiphertext ) ;
427
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
426
+ Assert . Equal ( expectedCiphertext , actualCiphertext . AsSpan ( ) ) ;
427
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
428
428
return expectedPlaintext ;
429
429
} ) ;
430
430
var mockDescriptor = new Mock < IAuthenticatedEncryptorDescriptor > ( ) ;
@@ -470,8 +470,8 @@ public void Unprotect_IsAlsoDefaultKey_Success_NoMigrationRequired()
470
470
. Setup ( o => o . Decrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
471
471
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualCiphertext , actualAad ) =>
472
472
{
473
- Assert . Equal ( expectedCiphertext . AsSpan ( ) , actualCiphertext ) ;
474
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
473
+ Assert . Equal ( expectedCiphertext , actualCiphertext . AsSpan ( ) ) ;
474
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
475
475
return expectedPlaintext ;
476
476
} ) ;
477
477
var mockDescriptor = new Mock < IAuthenticatedEncryptorDescriptor > ( ) ;
@@ -519,8 +519,8 @@ public void Unprotect_IsNotDefaultKey_Success_RequiresMigration()
519
519
. Setup ( o => o . Decrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
520
520
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualCiphertext , actualAad ) =>
521
521
{
522
- Assert . Equal ( expectedCiphertext . AsSpan ( ) , actualCiphertext ) ;
523
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
522
+ Assert . Equal ( expectedCiphertext , actualCiphertext . AsSpan ( ) ) ;
523
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
524
524
return expectedPlaintext ;
525
525
} ) ;
526
526
var mockDescriptor = new Mock < IAuthenticatedEncryptorDescriptor > ( ) ;
@@ -594,8 +594,8 @@ public void CreateProtector_ChainsPurposes()
594
594
. Setup ( o => o . Encrypt ( It . IsAny < ArraySegment < byte > > ( ) , It . IsAny < ArraySegment < byte > > ( ) ) )
595
595
. Returns < ArraySegment < byte > , ArraySegment < byte > > ( ( actualPlaintext , actualAad ) =>
596
596
{
597
- Assert . Equal ( expectedPlaintext . AsSpan ( ) , actualPlaintext ) ;
598
- Assert . Equal ( expectedAad . AsSpan ( ) , actualAad ) ;
597
+ Assert . Equal ( expectedPlaintext , actualPlaintext . AsSpan ( ) ) ;
598
+ Assert . Equal ( expectedAad , actualAad . AsSpan ( ) ) ;
599
599
return new byte [ ] { 0x23 , 0x29 , 0x31 , 0x37 } ; // ciphertext + tag
600
600
} ) ;
601
601
0 commit comments