예제 #1
0
        public void BigEndianLong()
        {
            var data = KeyUtilities.GetBigEndianBytes(1L);

            Assert.AreEqual(8, data.Length);
            foreach (var bte in data.Take(7))
            {
                Assert.AreEqual(0x00, bte);
            }

            Assert.AreEqual(0x01, data.Last());
        }
예제 #2
0
파일: Hotp.cs 프로젝트: shugaoye/otp-sharp
        /// <remarks>
        /// This method mainly exists for unit tests.
        /// The RFC defines a decimal value in the test table that is an
        /// intermediate step to a final HOTP value
        /// </remarks>
        internal long ComputeHotpDecimal(long counter, OtpHashMode mode)
        {
            var hashData = KeyUtilities.GetBigEndianBytes(counter);

            return(this.CalculateOtp(hashData, mode));
        }