summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Whittington <bc@whittington.net.nz>2013-10-18 11:37:29 +1300
committerTim Whittington <bc@whittington.net.nz>2013-10-18 11:37:29 +1300
commit1e4f49c613d7285692a39ab5aa5614640c1c47a8 (patch)
tree1060966b7ccf797366d6290954fd019d5cd02d37
parentPort reduced round Salsa20, registerised Salsa20 core, XSalsa20 and ChaCha fr... (diff)
downloadBouncyCastle.NET-ed25519-1e4f49c613d7285692a39ab5aa5614640c1c47a8.tar.xz
Make ChaCha and Salsa20 engines CLSCompliant.
-rw-r--r--crypto/src/crypto/engines/ChaChaEngine.cs3
-rw-r--r--crypto/src/crypto/engines/Salsa20Engine.cs9
2 files changed, 5 insertions, 7 deletions
diff --git a/crypto/src/crypto/engines/ChaChaEngine.cs b/crypto/src/crypto/engines/ChaChaEngine.cs
index 0971b8035..2aeb30d86 100644
--- a/crypto/src/crypto/engines/ChaChaEngine.cs
+++ b/crypto/src/crypto/engines/ChaChaEngine.cs
@@ -6,7 +6,6 @@ namespace Org.BouncyCastle.Crypto.Engines
 	/**
 	 * Implementation of Daniel J. Bernstein's ChaCha stream cipher.
 	 */
-	[CLSCompliantAttribute(false)]
 	public class ChaChaEngine
 		: Salsa20Engine
 	{
@@ -101,7 +100,7 @@ namespace Org.BouncyCastle.Crypto.Engines
 	     *
 	     * @return  keystream
 	     */
-		protected internal static void ChachaCore(int rounds, uint[] input, uint[] x)
+		internal static void ChachaCore(int rounds, uint[] input, uint[] x)
 		{
 			if (input.Length != 16) {
 				throw new ArgumentException();
diff --git a/crypto/src/crypto/engines/Salsa20Engine.cs b/crypto/src/crypto/engines/Salsa20Engine.cs
index 5698737de..aff6320b1 100644
--- a/crypto/src/crypto/engines/Salsa20Engine.cs
+++ b/crypto/src/crypto/engines/Salsa20Engine.cs
@@ -10,7 +10,6 @@ namespace Org.BouncyCastle.Crypto.Engines
 	/**
 	 * Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005
 	 */
-	[CLSCompliantAttribute(false)]
 	public class Salsa20Engine
 		: IStreamCipher
 	{
@@ -30,8 +29,8 @@ namespace Org.BouncyCastle.Crypto.Engines
 		 * during encryption and decryption
 		 */
 		private int		 index = 0;
-		protected uint[] engineState = new uint[StateSize]; // state
-		protected uint[] x = new uint[StateSize]; // internal buffer
+		internal uint[] engineState = new uint[StateSize]; // state
+		internal uint[] x = new uint[StateSize]; // internal buffer
 		private byte[]	 keyStream = new byte[StateSize * 4]; // expanded state, 64 bytes
 		private bool	 initialised = false;
 
@@ -242,7 +241,7 @@ namespace Org.BouncyCastle.Crypto.Engines
 			Pack.UInt32_To_LE(x, output, 0);
 		}
 
-		protected internal static void SalsaCore(int rounds, uint[] input, uint[] x)
+		internal static void SalsaCore(int rounds, uint[] input, uint[] x)
 		{
 			if (input.Length != 16) {
 				throw new ArgumentException();
@@ -334,7 +333,7 @@ namespace Org.BouncyCastle.Crypto.Engines
 		 *
 		 * @return  rotated x
 		 */
-		protected static uint R(uint x, int y)
+		internal static uint R(uint x, int y)
 		{
 			return (x << y) | (x >> (32 - y));
 		}