Check that s2k-count has changed

Hauke Laging mailinglisten at hauke-laging.de
Fri Jul 8 21:06:24 CEST 2011


Am Freitag, 8. Juli 2011, 20:35:57 schrieb Chris Poole:
> On 8 Jul 2011, at 17:31, David Shaw <dshaw at jabberwocky.com> wrote:
> > Yes.  Note that the list-packets output shows the internal packed value:
> > 6553600 should come out to 201.  The default of 65536 would encode to
> > 96.
> 
> I do indeed get 201. Out of interest, how is that calculated?

https://tools.ietf.org/html/rfc4880#section-3.7.1.3

The count is coded into a one-octet number using the following formula:

    #define EXPBIAS 6
    count = ((Int32)16 + (c & 15)) << ((c >> 4) + EXPBIAS);

The above formula is in C, where "Int32" is a type for a 32-bit
integer, and the variable "c" is the coded count, Octet 10.


Hauke
-- 
PGP: D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 555 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/attachments/20110708/ead2546b/attachment.pgp>


More information about the Gnupg-users mailing list