/* This function sanity-checks the internal table of supported CHAP hashing algorithms, as well.  */
VOID IScsiCHAPInitHashList(VOID)
/* This function sanity-checks the internal table of supported CHAP hashing algorithms, as well.  */
VOID IScsiCHAPInitHashList(VOID)
{
  CHAR8            *Position;
  UINTN            Left;
  UINTN            HashIndex;
  CONST CHAP_HASH  *Hash;
  UINTN            Printed;
  Position = mChapHashListString;
  Left     = sizeof (mChapHashListString);
  for (HashIndex = 0; HashIndex < ARRAY_SIZE (mChapHash); HashIndex++) {
    Hash = &mChapHash[HashIndex];
    ASSERT (Left >= 2);
    Printed = AsciiSPrint (
                Position,
                Left,
                "%a%d",
                (HashIndex == 0) ? "" : ",",
                Hash->Algorithm
                );
    ASSERT (Printed + 1 < Left);
    Position += Printed;
    Left     -= Printed;
    ASSERT (Hash->DigestSize <= ISCSI_CHAP_MAX_DIGEST_SIZE);
  }
}