HashFunctionChoice enum

Hash algorithms available for use in SRP operations.

These algorithms are used throughout the SRP protocol for:

  • Hashing user IDs and safe primes
  • Deriving session keys
  • Computing verifiers

Security Considerations:

  • sha256 is recommended for most use cases (balance of security and performance)
  • sha512 provides stronger security but with performance penalty on 32-bit systems
  • sha1 is provided for RFC5054 compatibility and low-resource environments only

The hash function choice must match between client and server, and must be the same during both registration and authentication phases.

Inheritance
Available extensions

Values

sha1 → const HashFunctionChoice

SHA-1 hash algorithm (160-bit output).

Warning: SHA-1 is cryptographically weak and provided only for compatibility with RFC5054 and legacy systems. Not recommended for production use unless required for interoperability.

sha256 → const HashFunctionChoice

SHA-256 hash algorithm (256-bit output).

Recommended default for most applications. Provides good security with excellent performance across all platforms.

sha512 → const HashFunctionChoice

SHA-512 hash algorithm (512-bit output).

Provides stronger security than SHA-256 but may have performance penalty on 32-bit systems. Use when maximum security is required.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<HashFunctionChoice>
A constant List of the values in this enum, in order of their declaration.