@@ -25,7 +25,7 @@ private static class Native
2525
2626 [ DllImport ( "libsodium" , CallingConvention = CallingConvention . Cdecl ) ]
2727 [ DefaultDllImportSearchPaths ( DllImportSearchPath . AssemblyDirectory | DllImportSearchPath . SafeDirectories ) ]
28- public static extern int crypto_box_seal_open ( byte [ ] decrypted , byte [ ] ciphertext , ulong clen , byte [ ] publicKey , byte [ ] privateKey ) ;
28+ public static extern int crypto_box_seal_open ( byte [ ] decrypted , byte [ ] ciphertext , ulong ciphertextLength , byte [ ] publicKey , byte [ ] privateKey ) ;
2929
3030 [ DllImport ( "libsodium" , CallingConvention = CallingConvention . Cdecl ) ]
3131 [ DefaultDllImportSearchPaths ( DllImportSearchPath . AssemblyDirectory | DllImportSearchPath . SafeDirectories ) ]
@@ -75,20 +75,20 @@ public static int crypto_box_seal(byte[] ciphertext, byte[] message, ulong mlen,
7575 return Native . crypto_box_seal ( ciphertext , message , mlen , publicKey ) ;
7676 }
7777
78- public static int crypto_box_seal_open ( byte [ ] decrypted , byte [ ] ciphertext , ulong clen , byte [ ] publicKey , byte [ ] privateKey )
78+ public static int crypto_box_seal_open ( byte [ ] decrypted , byte [ ] ciphertext , ulong ciphertextLength , byte [ ] publicKey , byte [ ] privateKey )
7979 {
8080 var sealBytes = crypto_box_sealbytes ( ) . ToUInt64 ( ) ;
81- if ( clen < sealBytes )
81+ if ( ciphertextLength < sealBytes )
8282 {
8383 throw new ArgumentException ( $ "The ciphertext must be at least { sealBytes } bytes.", nameof ( ciphertext ) ) ;
8484 }
8585
86- ValidateMinimumBufferLength ( ciphertext , clen , nameof ( ciphertext ) ) ;
87- ValidateMinimumBufferLength ( decrypted , clen - sealBytes , nameof ( decrypted ) ) ;
86+ ValidateMinimumBufferLength ( ciphertext , ciphertextLength , nameof ( ciphertext ) ) ;
87+ ValidateMinimumBufferLength ( decrypted , ciphertextLength - sealBytes , nameof ( decrypted ) ) ;
8888 ValidateExactBufferLength ( publicKey , GetRequiredLength ( crypto_box_publickeybytes ( ) ) , nameof ( publicKey ) ) ;
8989 ValidateExactBufferLength ( privateKey , GetRequiredLength ( crypto_box_secretkeybytes ( ) ) , nameof ( privateKey ) ) ;
9090
91- return Native . crypto_box_seal_open ( decrypted , ciphertext , clen , publicKey , privateKey ) ;
91+ return Native . crypto_box_seal_open ( decrypted , ciphertext , ciphertextLength , publicKey , privateKey ) ;
9292 }
9393
9494 public static UIntPtr crypto_box_publickeybytes ( )
0 commit comments