anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   -compile({inline, [bsignature/2]}).
  -bsignature(SigningInput, #'ECPrivateKey'{}=Key) when is_binary(SigningInput) ->
  -    Sig = public_key:sign(SigningInput, ?DIGEST_TYPE, Key),
  +bsignature(SigningInput, #'ECPrivateKey'{}=PK) when is_binary(SigningInput) ->
  +    Key = [PK#'ECPrivateKey'.privateKey, ?CURVE],
  +    Sig = crypto:sign(?ALGORITHM, ?DIGEST_TYPE, SigningInput, Key),
       maybe_der_decode_sig(Sig).
   
   %%--------------------------------------------------------------------
  
positive.code:             Sig
      end.
  
  
negative.code: -spec get_private_key(SigningKeyPem) -> PrivateKey when
        SigningKeyPem :: pem_encoded_key(), PrivateKey :: ec_private_key().
  get_private_key(SigningKeyPem) ->
      ExpType = 'PrivateKeyInfo',
      case public_key:pem_decode(SigningKeyPem) of
          [{ExpType, DER, _}] ->
              #'PrivateKeyInfo'{}=PKI = public_key:der_decode(ExpType, DER),
              %% So this isn't the end of it - the privateKey component of
              %% 'PrivateKeyInfo' is just an OCTET-STRING that needs to be
              %% further decoded as an ECPrivateKey.
              PrivKeyOctets = PKI#'PrivateKeyInfo'.privateKey,
              %% -record('ECPrivateKey', {version, privateKey, parameters,
              %%                          publicKey}).
              {ok, ECPK} = 'OTP-PUB-KEY':decode('ECPrivateKey', PrivKeyOctets),
              ECPK;
          [{UnexpType, _, _}] ->
              throw({unexpected_signing_key_type, UnexpType})
      end.
  
  %%--------------------------------------------------------------------
  %% @doc Generate a private key. This is mostly useful for testing.
  