OCB_ntz() protected static method

protected static OCB_ntz ( long x ) : int
x long
return int
Example #1
0
 protected virtual void ProcessMainBlock(byte[] output, int outOff)
 {
     Check.DataLength(output, outOff, 16, "Output buffer too short");
     if (this.forEncryption)
     {
         OcbBlockCipher.Xor(this.Checksum, this.mainBlock);
         this.mainBlockPos = 0;
     }
     OcbBlockCipher.Xor(this.OffsetMAIN, this.GetLSub(OcbBlockCipher.OCB_ntz(this.mainBlockCount += 1L)));
     OcbBlockCipher.Xor(this.mainBlock, this.OffsetMAIN);
     this.mainCipher.ProcessBlock(this.mainBlock, 0, this.mainBlock, 0);
     OcbBlockCipher.Xor(this.mainBlock, this.OffsetMAIN);
     Array.Copy(this.mainBlock, 0, output, outOff, 16);
     if (!this.forEncryption)
     {
         OcbBlockCipher.Xor(this.Checksum, this.mainBlock);
         Array.Copy(this.mainBlock, 16, this.mainBlock, 0, this.macSize);
         this.mainBlockPos = this.macSize;
     }
 }
Example #2
0
 protected virtual void ProcessHashBlock()
 {
     this.UpdateHASH(this.GetLSub(OcbBlockCipher.OCB_ntz(this.hashBlockCount += 1L)));
     this.hashBlockPos = 0;
 }