Skip to content

Commit

Permalink
src: Rephrase incremental exception messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-lucas6 committed Sep 30, 2023
1 parent 56a9c41 commit 6b9ed8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Geralt/Crypto/IncrementalBLAKE2b.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private unsafe void Initialize(ReadOnlySpan<byte> key)
fixed (byte* k = key)
{
int ret = crypto_generichash_init(ref _state, k, (nuint)key.Length, (nuint)_hashSize);
if (ret != 0) { throw new CryptographicException("Error initializing hash."); }
if (ret != 0) { throw new CryptographicException("Error initializing hash function state."); }
}
}

Expand All @@ -44,7 +44,7 @@ public unsafe void Update(ReadOnlySpan<byte> message)
fixed (byte* m = message)
{
int ret = crypto_generichash_update(ref _state, m, (ulong)message.Length);
if (ret != 0) { throw new CryptographicException("Error updating hash."); }
if (ret != 0) { throw new CryptographicException("Error updating hash function state."); }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Geralt/Crypto/IncrementalEd25519ph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public IncrementalEd25519ph()
private void Initialize()
{
int ret = crypto_sign_init(ref _state);
if (ret != 0) { throw new CryptographicException("Error initializing signature scheme."); }
if (ret != 0) { throw new CryptographicException("Error initializing signature scheme state."); }
}

public unsafe void Update(ReadOnlySpan<byte> message)
Expand All @@ -31,7 +31,7 @@ public unsafe void Update(ReadOnlySpan<byte> message)
fixed (byte* m = message)
{
int ret = crypto_sign_update(ref _state, m, (ulong)message.Length);
if (ret != 0) { throw new CryptographicException("Error updating signature scheme."); }
if (ret != 0) { throw new CryptographicException("Error updating signature scheme state."); }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Geralt/Crypto/IncrementalPoly1305.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private unsafe void Initialize(ReadOnlySpan<byte> oneTimeKey)
fixed (byte* k = oneTimeKey)
{
int ret = crypto_onetimeauth_init(ref _state, k);
if (ret != 0) { throw new CryptographicException("Error initializing message authentication code."); }
if (ret != 0) { throw new CryptographicException("Error initializing message authentication code state."); }
}
}

Expand All @@ -34,7 +34,7 @@ public unsafe void Update(ReadOnlySpan<byte> message)
fixed (byte* m = message)
{
int ret = crypto_onetimeauth_update(ref _state, m, (ulong)message.Length);
if (ret != 0) { throw new CryptographicException("Error updating message authentication code."); }
if (ret != 0) { throw new CryptographicException("Error updating message authentication code state."); }
}
}

Expand Down

0 comments on commit 6b9ed8f

Please sign in to comment.