Permutation() static private method

static private Permutation ( byte input, byte output, uint permTab, bool preSwap ) : void
input byte
output byte
permTab uint
preSwap bool
return void
コード例 #1
0
 // note: this method is garanteed to be called with a valid blocksize
 // for both input and output
 protected override void ECB(byte[] input, byte[] output)
 {
     DESTransform.Permutation(input, output, DESTransform.ipTab, false);
     if (encrypt)
     {
         E1.ProcessBlock(output, output);
         D2.ProcessBlock(output, output);
         E3.ProcessBlock(output, output);
     }
     else
     {
         D1.ProcessBlock(output, output);
         E2.ProcessBlock(output, output);
         D3.ProcessBlock(output, output);
     }
     DESTransform.Permutation(output, output, DESTransform.fpTab, true);
 }
コード例 #2
0
 protected override void ECB(byte[] input, byte[] output)
 {
     DESTransform.Permutation(input, output, DESTransform.ipTab, false);
     this.ProcessBlock(output, this.byteBuff);
     DESTransform.Permutation(this.byteBuff, output, DESTransform.fpTab, true);
 }