IAlphabetMapper.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto
  5. {
  6. /**
  7. * Base interface for mapping from an alphabet to a set of indexes
  8. * suitable for use with FPE.
  9. */
  10. public interface IAlphabetMapper
  11. {
  12. /// <summary>
  13. /// Return the number of characters in the alphabet.
  14. /// </summary>
  15. /// <returns>the radix for the alphabet.</returns>
  16. int Radix { get; }
  17. /// <summary>
  18. /// Return the passed in char[] as a byte array of indexes (indexes
  19. /// can be more than 1 byte)
  20. /// </summary>
  21. /// <returns>an index array.</returns>
  22. /// <param name="input">characters to be mapped.</param>
  23. byte[] ConvertToIndexes(char[] input);
  24. /// <summary>
  25. /// Return a char[] for this alphabet based on the indexes passed.
  26. /// </summary>
  27. /// <returns>an array of char corresponding to the index values.</returns>
  28. /// <param name="input">input array of indexes.</param>
  29. char[] ConvertToChars(byte[] input);
  30. }
  31. }
  32. #pragma warning restore
  33. #endif