/// <summary> /// Gets the platform enum value for the block mode used by the specified algorithm. /// </summary> /// <param name="algorithm">The algorithm.</param> /// <returns>The platform-specific enum value describing the block mode.</returns> private static Platform.CipherMode GetMode(SymmetricAlgorithm algorithm) { switch (algorithm.GetMode()) { case SymmetricAlgorithmMode.Cbc: return Platform.CipherMode.CBC; case SymmetricAlgorithmMode.Ecb: return Platform.CipherMode.ECB; default: throw new NotSupportedException(); } }