Check if private 'd' paramter of EC JWKs is correctly padded

Issue #78 resolved
Vladimir Dzhuvinov created an issue

Comments (3)

  1. Vladimir Dzhuvinov reporter

    The length of [the d] octet string MUST be ceiling(log-base-2(n)/8) octets (where n is the order of the curve).


    Order of curve P-256 is BigInteger

    115792089210356248762697446949407573529996955224135760342422259061068512044369
    

    Computation seems infeasible, consider using table lookup.

  2. Vladimir Dzhuvinov reporter

    The 'd' parameter is leading zero padded up the curve field size (the std P-256/384/512 curves have 'x', 'y' and 'd' parameters with the same length). The curve order - based calculation is not used. See commit fa37b29.

  3. Log in to comment