MemoryLimit

public enum MemoryLimit

Defines how much memory will be required for hashing a password. This makes brute-forcing more costly. The speed requirements induced by increased CPU load can be reduced by massively parallelizing the attack using FPGAs. As these have limited memory, this factor mitigates those attacks. You might be required to chose high or medium if your device is not equipped with much memory.

  • This requires about 64 MiB memory.

    Declaration

    Swift

    case medium
  • This requires about 256 MiB memory.

    Declaration

    Swift

    case high
  • This requires about 1 GiB memory.

    Declaration

    Swift

    case veryHigh
  • Helper function to translate the MemoryLimit enum to the values expected by libsodium.

    Declaration

    Swift

    fileprivate var sodiumValue: Int { get }

    Return Value

    The memory limit that can be interpreted by libsodium.

  • Translates a given value from libsodium to a corresponding enum value.

    Declaration

    Swift

    fileprivate init?(value: Int)

    Parameters

    value

    The complexity limit that can be interpreted by libsodium.