Lines Matching refs:width
17 …static public ulong Scramble(ulong data, ulong key, int width = OriginalDataWidth, uint rounds = O… in Scramble() argument
19 if(width < 0 || width > 64) in Scramble()
23 if(data > (ulong.MaxValue >> (64 - width))) in Scramble()
32 state = Substitute(state, width, coefficientsForward); in Scramble()
33 state = Permutate(state, width); in Scramble()
39 …static public ulong Descramble(ulong data, ulong key, int width = OriginalDataWidth, uint rounds =… in Descramble() argument
41 if(width < 0 || width > 64) in Descramble()
45 if(data > (ulong.MaxValue >> (64 - width))) in Descramble()
54 state = ReversePermutate(state, width); in Descramble()
55 state = Substitute(state, width, coefficientsReverse); in Descramble()
61 static private ulong Substitute(ulong data, int width, ulong[] coefficients) in Substitute() argument
63 var mask = ulong.MaxValue >> (64 - width); in Substitute()
64 var substitutionMask = ulong.MaxValue >> (64 - (width & ~0x3)); in Substitute()
67 for(int i = 0; i < width / 4; ++i) in Substitute()
76 static private ulong Permutate(ulong data, int width) in Permutate() argument
78 var mask = ulong.MaxValue >> (64 - width); in Permutate()
79 var permutationMask = ulong.MaxValue >> (64 - (width & ~0x1)); in Permutate()
81 var reversedData = BitHelper.ReverseBits(data << (64 - width)); in Permutate()
83 for(byte j = 0; j < width / 2; ++j) in Permutate()
86 …BitHelper.SetBit(ref state, (byte)(width / 2 + j), BitHelper.IsBitSet(reversedData, (byte)(2 * j +… in Permutate()
92 static private ulong ReversePermutate(ulong data, int width) in ReversePermutate() argument
94 var mask = ulong.MaxValue >> (64 - width); in ReversePermutate()
95 var permutationMask = ulong.MaxValue >> (64 - (width & ~0x1)); in ReversePermutate()
98 for(byte j = 0; j < width / 2; ++j) in ReversePermutate()
101 … BitHelper.SetBit(ref state, (byte)(2 * j + 1), BitHelper.IsBitSet(data, (byte)(width / 2 + j))); in ReversePermutate()
104 return BitHelper.ReverseBits(state << (64 - width)); in ReversePermutate()