Exemplo n.º 1
0
 private void ProcessBlock(int bytes)
 {
     // Set the key to the current state
     cipher.SetKey(state);
     // Update tweak
     UbiParameters.BitsProcessed += (ulong)bytes;
     cipher.SetTweak(UbiParameters.Tweak);
     // Encrypt block
     cipher.Encrypt(cipherInput, state);
     // Feed-forward input with state
     for (int i = 0; i < cipherInput.Length; i++)
     {
         state[i] ^= cipherInput[i];
     }
 }
Exemplo n.º 2
0
 public void InternalSetTweak(ulong[] tweak)
 {
     cipher.SetTweak(tweak);
 }