Org.BouncyCastle.Crypto.Digests.Sha512tDigest.UInt64_To_BE C# (CSharp) Method

UInt64_To_BE() private static method

private static UInt64_To_BE ( ulong n, byte bs, int off, int max ) : void
n ulong
bs byte
off int
max int
return void
        private static void UInt64_To_BE(ulong n, byte[] bs, int off, int max)
        {
            if (max > 0)
            {
                UInt32_To_BE((uint)(n >> 32), bs, off, max);

                if (max > 4)
                {
                    UInt32_To_BE((uint)n, bs, off + 4, max - 4);
                }
            }
        }

Usage Example

コード例 #1
0
 public override int DoFinal(byte[] output, int outOff)
 {
     base.Finish();
     Sha512tDigest.UInt64_To_BE(this.H1, output, outOff, this.digestLength);
     Sha512tDigest.UInt64_To_BE(this.H2, output, outOff + 8, this.digestLength - 8);
     Sha512tDigest.UInt64_To_BE(this.H3, output, outOff + 16, this.digestLength - 16);
     Sha512tDigest.UInt64_To_BE(this.H4, output, outOff + 24, this.digestLength - 24);
     Sha512tDigest.UInt64_To_BE(this.H5, output, outOff + 32, this.digestLength - 32);
     Sha512tDigest.UInt64_To_BE(this.H6, output, outOff + 40, this.digestLength - 40);
     Sha512tDigest.UInt64_To_BE(this.H7, output, outOff + 48, this.digestLength - 48);
     Sha512tDigest.UInt64_To_BE(this.H8, output, outOff + 56, this.digestLength - 56);
     this.Reset();
     return(this.digestLength);
 }