You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Snuffle base class's constructor's first parameter is in byte[] key which doesn't make sense, in is same as ref keyword (which means a reference to the specified value rather than value itself as you know) with the difference that in doesn't allow modifications to the value that being referenced (at the language level).
So what is happening here in this constructor is that we are passing a reference to a byte array (which arrays are references too) so the goal we are looking for (a read-only input or const char *key in C) is not achieved here. In order to fix this problem, we have to replace the in byte[] key with ReadOnlyMemory<byte> key which introduces a lot of changes in the code plus it is a breaking change.
Regards.
The text was updated successfully, but these errors were encountered:
The Snuffle base class's constructor's first parameter is
in byte[] key
which doesn't make sense,in
is same asref
keyword (which means a reference to the specified value rather than value itself as you know) with the difference thatin
doesn't allow modifications to the value that being referenced (at the language level).https://github.com/idaviddesmet/NaCl.Core/blob/54372a2914d9f770d1bd3c42898fb17928f57a28/src/NaCl.Core/Base/Snuffle.cs#L40
So what is happening here in this constructor is that we are passing a reference to a byte array (which arrays are references too) so the goal we are looking for (a read-only input or
const char *key
in C) is not achieved here. In order to fix this problem, we have to replace thein byte[] key
withReadOnlyMemory<byte> key
which introduces a lot of changes in the code plus it is a breaking change.Regards.
The text was updated successfully, but these errors were encountered: