TweakableBlockCipherParameters.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. /// <summary>
  8. /// Parameters for tweakable block ciphers.
  9. /// </summary>
  10. public class TweakableBlockCipherParameters
  11. : ICipherParameters
  12. {
  13. private readonly byte[] tweak;
  14. private readonly KeyParameter key;
  15. public TweakableBlockCipherParameters(KeyParameter key, byte[] tweak)
  16. {
  17. this.key = key;
  18. this.tweak = Arrays.Clone(tweak);
  19. }
  20. /// <summary>
  21. /// Gets the key.
  22. /// </summary>
  23. /// <value>the key to use, or <code>null</code> to use the current key.</value>
  24. public KeyParameter Key
  25. {
  26. get { return key; }
  27. }
  28. /// <summary>
  29. /// Gets the tweak value.
  30. /// </summary>
  31. /// <value>The tweak to use, or <code>null</code> to use the current tweak.</value>
  32. public byte[] Tweak
  33. {
  34. get { return tweak; }
  35. }
  36. }
  37. }
  38. #pragma warning restore
  39. #endif