public override byte[] ProcessByte(byte input) { return(new byte[1] { cipher.ReturnByte(input) }); }
internal static void BcUpdateStream(this IStreamCipher cipher, ReadOnlySpan <byte> source, Span <byte> destination) { if (destination.Length < source.Length) { throw new ArgumentException(string.Empty, nameof(destination)); } for (var i = 0; i < source.Length; ++i) { destination[i] = cipher.ReturnByte(source[i]); } }
private void HCTest(IStreamCipher hc, string test, byte[] key, byte[] IV, byte[] expected) { KeyParameter kp = new KeyParameter(key); ParametersWithIV ivp = new ParametersWithIV(kp, IV); hc.Init(true, ivp); for (int i = 0; i < 64; i++) { if (hc.ReturnByte(MSG[i]) != expected[i]) { Fail(test + " failure at byte " + i); } } }