Skip to content

Allow to set saltLength for RSA-PSS #17

@tex0l

Description

@tex0l

Currently, the saltLength used for PSS signatures is the cryptopp default one of 32 bytes.

However, it is very common to specify it (the RFC has this parameters available https://www.rfc-editor.org/rfc/rfc3447#section-9.1.1). Here are examples in JS that allow to:

Would it be possible to set such a parameter upon signing?

I made it work like this with a hard-coded salt value of 478 bytes (see above why 478):

struct PSS_CUSTOM : public SignatureStandard
{
    typedef PSSR_MEM<false, P1363_MGF1, 478> SignatureMessageEncodingMethod;
};

and then instead of setting PSSR I set PSS_CUSTOM. It is compatible with my reference implementation.

EDIT: I wasnt able to pass a saltLength as an argument, as the saltLength of 478 I set in my example is defined statically and not dynamically.. I don't see how it'd be possible with cryptopp to pass it dynamically, I'm not fluent enough in cpp... Do you think of anything? This is really blocking for me, as I need to make this implementation compatible with the node.js default implementation of PSS which used the max salt length.

EDIT2: apparently, the saltLength can only be set as a template parameter at compile time.. see https://groups.google.com/g/cryptopp-users/c/UFVcV9Ml_Cs/m/NFYEfxhF0CEJ would it be possible to define a max PSS length for relevant hashing algorithms and key sizes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions