Mini private key, PBKDF2 rounding

2

There are two formats of mini private keys, one is based on SHA-256, other on PBKDF2. In the instructions for decoding the second one, we read:

"The iteration count is determined as follows: 2 ^ (n/4) rounded to the nearest integer, where n is the second byte."

Does the rounding refer to the value of (n/4), or 2 ^ (n/4)? For example, for n=9, we have:

n/4=9/4=2.25
2^(n/4)=2^(9/4)=4.75682846

If we round the result of the second equation, we get 5, but if we round the result of the first equation, we get:

2^2=4

Which is a bit of an inconsistency.

Where should one apply rounding for calculating the proper PBKDF2-encoded mini private key?

EDIT: Moreover, should the division by 4 should be carried out arithmetically (rounding the number to nearest integer, with 0.5 being rounded up), or by a logical shift (the number is rounded down).

ThePiachu

Posted 2012-01-11T02:26:05.663

Reputation: 41 594

Answers

0

As it is already being discussed on the forum, the standard is currently not in use by anyone, so its implementation details can change over time.

ThePiachu

Posted 2012-01-11T02:26:05.663

Reputation: 41 594