Subject: Re: questions about sections 3.6.1.2 and 3.6.1.3 (was Re: question about section 3.6.1.1 simple s2k: how does preloading work?)

From: [email-masked]
Date: Wed, 17 May 2000 08:39:08 -0700

> what happens in the case where the computed octet count is:
>
>   -not an integer multiple of the length of salt + passphrase and
>   -greater than the length of salt + passphrase
>
> ?
>
> i presume that exactly "computed octet count" octets are handed to the
> message digest algorithm (+ message digest padding), and not an
> integer multiple number of instances of salt + passphrase.

Yes.

> so the last octet before message digest padding would not be the last
> octet of the passphrase, as section 3.6.1.3 says:
>
>    Then the salt, followed by the passphrase data is repeatedly hashed
>    until the number of octets specified by the octet count has been
>    hashed.  The one exception is that if the octet count is less than
>    the size of the salt plus passphrase, the full salt plus passphrase
>    will be hashed even though that is greater than the octet count.
>
> is this correct?

Yes, but I don't believe 3.6.1.3 says that the last octet before message
digest padding would be the last octet of the passphrase.

Hal

---

From: [email-masked]
Date: Thu, 18 May 2000 10:06:13 +0900

From: [email-masked]
Subject: Re: questions about sections 3.6.1.2 and 3.6.1.3 (was Re: question about section 3.6.1.1 simple s2k: how does preloading work?)
Date: Wed, 17 May 2000 08:39:08 -0700
Message-ID: <[email-masked]>

> digest padding would be the last octet of the passphrase.

you are absolutely correct -- i agree that the section doesn't say
that.

the reason i asked this question was that since in the case where the
computed octet count is less than the length of the salt + passphrase,
the full salt + passphrase is hashed, one possible generalization for
the cases where the computed octet count is greater than the length of
the salt + passphrase would be to hash on salt + passphrase
boundaries.

what i found slightly ambiguous was the phrase:

   "until the number of ... has been hashed."

i would probably not have been confused if the phrasing had been:

  "until exactly the number of ... has been hashed."

thanks for the clarification.