DesFunc() static private method

static private DesFunc ( int wKey, byte input, int inOff, byte outBytes, int outOff ) : void
wKey int
input byte
inOff int
outBytes byte
outOff int
return void
Beispiel #1
0
 public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
 {
     if (this.workingKey == null)
     {
         throw new InvalidOperationException("DES engine not initialised");
     }
     Check.DataLength(input, inOff, 8, "input buffer too short");
     Check.OutputLength(output, outOff, 8, "output buffer too short");
     DesEngine.DesFunc(this.workingKey, input, inOff, output, outOff);
     return(8);
 }
 public override int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
 {
     if (this.workingKey1 == null)
     {
         throw new InvalidOperationException("DESede engine not initialised");
     }
     Check.DataLength(input, inOff, 8, "input buffer too short");
     Check.OutputLength(output, outOff, 8, "output buffer too short");
     byte[] array = new byte[8];
     if (this.forEncryption)
     {
         DesEngine.DesFunc(this.workingKey1, input, inOff, array, 0);
         DesEngine.DesFunc(this.workingKey2, array, 0, array, 0);
         DesEngine.DesFunc(this.workingKey3, array, 0, output, outOff);
     }
     else
     {
         DesEngine.DesFunc(this.workingKey3, input, inOff, array, 0);
         DesEngine.DesFunc(this.workingKey2, array, 0, array, 0);
         DesEngine.DesFunc(this.workingKey1, array, 0, output, outOff);
     }
     return(8);
 }
Beispiel #3
0
 public override int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
 {
     //IL_000d: Unknown result type (might be due to invalid IL or missing references)
     if (workingKey1 == null)
     {
         throw new InvalidOperationException("DESede engine not initialised");
     }
     Check.DataLength(input, inOff, 8, "input buffer too short");
     Check.OutputLength(output, outOff, 8, "output buffer too short");
     byte[] array = new byte[8];
     if (forEncryption)
     {
         DesEngine.DesFunc(workingKey1, input, inOff, array, 0);
         DesEngine.DesFunc(workingKey2, array, 0, array, 0);
         DesEngine.DesFunc(workingKey3, array, 0, output, outOff);
     }
     else
     {
         DesEngine.DesFunc(workingKey3, input, inOff, array, 0);
         DesEngine.DesFunc(workingKey2, array, 0, array, 0);
         DesEngine.DesFunc(workingKey1, array, 0, output, outOff);
     }
     return(8);
 }