public override byte[] GetBytes(int byteCount)
        {
            var result = new byte[byteCount];

            _xof.XofSizeInBits = (ulong)byteCount * 8;
            _xof.Initialize();
            _xof.TransformBytes(_srcKey);
            // derive the SubKey
            _xof.DoOutput(result, 0, (ulong)result.Length);
            _xof.Initialize();
            return(result);
        }
示例#2
0
        } // end function Clone

        public override byte[] GetBytes(Int32 byteCount)
        {
            var result = new byte[byteCount];

            Xof.XOFSizeInBits = (UInt64)byteCount * 8;
            Xof.Initialize();
            Xof.TransformBytes(SrcKey);
            // derive the SubKey
            Xof.DoOutput(ref result, 0, (UInt64)result.Length);
            Xof.Initialize();
            return(result);
        }
示例#3
0
        protected void DoComputeKMACXOF(IXOF xofInstance, byte[] data)
        {
            var result = new byte[xofInstance.XofSizeInBits >> 3];

            xofInstance.Initialize();
            xofInstance.TransformBytes(data);
            xofInstance.DoOutput(result, 0, (ulong)result.Length);

            ActualString = Converters.ConvertBytesToHexString(result);

            AssertAreEqual(ExpectedString, ActualString);
        }