Simplify RSA and EC public key formats #13

Merged
Patater merged 8 commits from pubkey-format into development 2019-01-25 04:09:40 -06:00
Patater commented 2019-01-11 05:44:16 -06:00 (Migrated from github.com)

Out of scope of this PR:

  • Completely remove dependency on the pk module
  • Update DH and DSA formats (see PR #14)
Out of scope of this PR: - Completely remove dependency on the pk module - Update DH and DSA formats (see PR #14)
Patater commented 2019-01-11 05:56:12 -06:00 (Migrated from github.com)

Force push to update commit descriptions.

Force push to update commit descriptions.
Patater commented 2019-01-11 09:45:46 -06:00 (Migrated from github.com)

Rebased to add format specification for DH and DSA keys, and remove the request for crypto know-howerage. No implementation updates required for those, as Mbed Crypto doesn't have a PSA-exposed implementation of DH or DSA yet.

Rebased to add format specification for DH and DSA keys, and remove the request for crypto know-howerage. No implementation updates required for those, as Mbed Crypto doesn't have a PSA-exposed implementation of DH or DSA yet.
Patater commented 2019-01-11 09:54:32 -06:00 (Migrated from github.com)

Rebase to fix memory leak fix (remember to free the imported "their_key") in ECDH.

Rebase to fix memory leak fix (remember to free the imported "their_key") in ECDH.
Patater commented 2019-01-11 10:40:03 -06:00 (Migrated from github.com)

Rebased and force-pushed an old version of this patchset so @gilles-peskine-arm can post his comments on the patchset he reviewed. Will push back the new version after no more active reviewers.

Rebased and force-pushed an old version of this patchset so @gilles-peskine-arm can post his comments on the patchset he reviewed. Will push back the new version after no more active reviewers.
gilles-peskine-arm (Migrated from github.com) requested changes 2019-01-11 10:57:30 -06:00
gilles-peskine-arm (Migrated from github.com) left a comment
  • crypto_sizes.h needs some updates: implementation and documentation of some of the PSA_KEY_EXPORT_xxx macros.
  • I haven't reviewed the changes to test data, but they look superficially ok.
* `crypto_sizes.h` needs some updates: implementation and documentation of some of the `PSA_KEY_EXPORT_xxx` macros. * I haven't reviewed the changes to test data, but they look superficially ok.
@ -448,8 +467,32 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* The output of this function can be passed to psa_import_key() to
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 08:50:39 -06:00

Remove this paragraph. SubjectPublicKeyInfo is no longer used. Use similar wording as in psa_export_key to introduce the list and the list elements.

Remove this paragraph. SubjectPublicKeyInfo is no longer used. Use similar wording as in `psa_export_key` to introduce the list and the list elements.
@ -453,0 +477,4 @@
* For standard key types, the output format is as follows:
* - For RSA public keys (#PSA_KEY_TYPE_RSA_PUBLIC_KEY), the DER encoding of
* the representation defined by RFC 3279 §2.3.1 as `RSAPublicKey`.
* ```
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:22:40 -06:00
 *   the format is the DER encoding of the representation defined by RFC 3279 §2.3.1 as `RSAPublicKey`.
```suggestion * the format is the DER encoding of the representation defined by RFC 3279 §2.3.1 as `RSAPublicKey`. ```
@ -459,21 +502,6 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL }
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:23:22 -06:00
 *   the format is the DER encoding of the representation defined by RFC 3279 §2.3.5 as
```suggestion * the format is the DER encoding of the representation defined by RFC 3279 §2.3.5 as ```
@ -2171,1 +2139,3 @@
* #PSA_ALG_IS_KEY_AGREEMENT(\p alg) is true).
* \param[in,out] generator The generator object to set up. It must have been
* initialized as per the documentation for
* #psa_crypto_generator_t and not yet in use.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:29:10 -06:00

More generally, the peer key must be in the same format that psa_import_key accepts for the public key type corresponding to the type of private_key. That is, this function performs the equivalent of psa_import_key(internal_public_key_handle, PSA_KEY_TYPE_PUBLIC_KEY_OF_KEYPAIR(private_key_type), peer_key, peer_key_length) where private_key_type is the type of private_key. For EC keys, this means that peer_key is interpreted as a point on the curve that the private key is on.

More generally, the peer key must be in the same format that `psa_import_key` accepts for the public key type corresponding to the type of `private_key`. That is, this function performs the equivalent of `psa_import_key(internal_public_key_handle, PSA_KEY_TYPE_PUBLIC_KEY_OF_KEYPAIR(private_key_type), peer_key, peer_key_length)` where `private_key_type` is the type of `private_key`. For EC keys, this means that `peer_key` is interpreted as a point on the curve that the private key is on.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:39:01 -06:00

Now that the pk logic is only used for RSA keys, please move it to psa_import_rsa_key.

Now that the pk logic is only used for RSA keys, please move it to `psa_import_rsa_key`.
@ -638,59 +701,29 @@ psa_status_t psa_import_key_into_slot( psa_key_slot_t *slot,
status = psa_import_ec_private_key( PSA_KEY_TYPE_GET_CURVE( slot->type ),
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:40:42 -06:00

This is confusing. The code is only used for public keys (which is fortunate because it only works for public keys) but this is not immediately apparent when reading the code. Please move the two ECC blocks together, and change the condition on the public-key block to PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY.

This is confusing. The code is only used for public keys (which is fortunate because it only works for public keys) but this is not immediately apparent when reading the code. Please move the two ECC blocks together, and change the condition on the public-key block to `PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY`.
@ -693,3 +726,3 @@
return( PSA_SUCCESS );
return( status );
}
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 08:25:24 -06:00

Good fix! It happened to be ok with our implementation because mbedtls_ecp_keypair_init sets everything to 0, but it was a bug with MBEDTLS_ECP_ALT implementations that don't set everything to 0.

Good fix! It happened to be ok with our implementation because `mbedtls_ecp_keypair_init` sets everything to 0, but it was a bug with `MBEDTLS_ECP_ALT` implementations that don't set everything to 0.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 08:29:24 -06:00

Should be under #if defined(MBEDTLS_RSA_C)

Should be under `#if defined(MBEDTLS_RSA_C)`
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 10:56:35 -06:00

#if defined(MBEDTLS_ECP_C)

`#if defined(MBEDTLS_ECP_C)`
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 08:29:52 -06:00

Should be under #if defined(MBEDTLS_RSA_C)

Should be under `#if defined(MBEDTLS_RSA_C)`
@ -973,1 +1022,4 @@
ret = pk_write_pubkey_simple( &pk, data, data_size );
}
else
{
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 10:56:38 -06:00

The two branches of this condition call identical functions. We may eventually have different code paths for RSA and ECC to decrease our reliance on pk, but it's too early for that. Just call mbedtls_pk_write_pubkey here.

The two branches of this condition call identical functions. We may eventually have different code paths for RSA and ECC to decrease our reliance on pk, but it's too early for that. Just call `mbedtls_pk_write_pubkey` here.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 09:43:10 -06:00

Instead of having each case end with if(status != PSA_SUCCESS) return status, I think this function would be clearer if it just did status = call_the_right_function_for_this_block() and then return( status ) at the end.

Instead of having each case end with `if(status != PSA_SUCCESS) return status`, I think this function would be clearer if it just did `status = call_the_right_function_for_this_block()` and then `return( status )` at the end.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 10:56:29 -06:00

???

???
Patater commented 2019-01-11 11:11:43 -06:00 (Migrated from github.com)

Rebased to update back to where we were before and additionally improve the Doxygen comments.

Rebased to update back to where we were before and additionally improve the Doxygen comments.
Patater (Migrated from github.com) reviewed 2019-01-11 11:39:41 -06:00
@ -2171,1 +2139,3 @@
* #PSA_ALG_IS_KEY_AGREEMENT(\p alg) is true).
* \param[in,out] generator The generator object to set up. It must have been
* initialized as per the documentation for
* #psa_crypto_generator_t and not yet in use.
Patater (Migrated from github.com) commented 2019-01-11 11:39:41 -06:00

Thanks for the explanation.

Do you suggest a change to the documentation here?

Thanks for the explanation. Do you suggest a change to the documentation here?
Patater (Migrated from github.com) reviewed 2019-01-11 11:57:38 -06:00
@ -638,59 +701,29 @@ psa_status_t psa_import_key_into_slot( psa_key_slot_t *slot,
status = psa_import_ec_private_key( PSA_KEY_TYPE_GET_CURVE( slot->type ),
Patater (Migrated from github.com) commented 2019-01-11 11:57:38 -06:00

Yeah, that's an obvious change to make now that we don't have a shared block for RSA and ECC public keys anymore.

Yeah, that's an obvious change to make now that we don't have a shared block for RSA and ECC public keys anymore.
Patater (Migrated from github.com) reviewed 2019-01-11 11:59:17 -06:00
Patater (Migrated from github.com) commented 2019-01-11 11:59:17 -06:00

Agreed, but out of scope for now.

Agreed, but out of scope for now.
Patater (Migrated from github.com) reviewed 2019-01-11 12:04:19 -06:00
Patater (Migrated from github.com) commented 2019-01-11 12:04:19 -06:00

This is something I noticed when reading the ASN.1 and reading SEC 1 (http://www.secg.org/sec1-v2.pdf). We previously were using BIT_STRING (0x03) instead of OCTET_STRING (0x04) per the standard.

ECPoint ::= OCTET STRING

This might be worth fling an inter-op bug about unless we know some reason using BIT_STRING is correct. It's not an issue for PSA anymore, since we won't use an ASN.1-formatted key, but is still a potential issue for Mbed TLS.

This is something I noticed when reading the ASN.1 and reading SEC 1 (http://www.secg.org/sec1-v2.pdf). We previously were using `BIT_STRING` (`0x03`) instead of `OCTET_STRING` (`0x04`) per the standard. ``` ECPoint ::= OCTET STRING ``` This might be worth fling an inter-op bug about unless we know some reason using `BIT_STRING` is correct. It's not an issue for PSA anymore, since we won't use an ASN.1-formatted key, but is still a potential issue for Mbed TLS.
Patater (Migrated from github.com) reviewed 2019-01-11 12:06:18 -06:00
@ -973,1 +1022,4 @@
ret = pk_write_pubkey_simple( &pk, data, data_size );
}
else
{
Patater (Migrated from github.com) commented 2019-01-11 12:06:17 -06:00

I was thinking to possibly do that in this PR, but since we can agree it's out of scope, I'll merge the implementations.

I was thinking to possibly do that in this PR, but since we can agree it's out of scope, I'll merge the implementations.
gilles-peskine-arm (Migrated from github.com) requested changes 2019-01-11 12:08:00 -06:00
gilles-peskine-arm (Migrated from github.com) left a comment

+ my comments from the previous review

\+ my comments from the previous review
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:22:02 -06:00

Missing a handle_t parameter

Missing a `handle_t` parameter
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:22:08 -06:00

const

`const`
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:22:31 -06:00

Not relevant for this function (you won't get a handle in the first place)

Not relevant for this function (you won't get a handle in the first place)
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:23:01 -06:00
  • INVALID_ARGUMENTS
+ `INVALID_ARGUMENTS`
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:23:56 -06:00

Not relevant for this function (you won't get a handle in the first place)

Not relevant for this function (you won't get a handle in the first place)
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:24:36 -06:00
  • INVALID_ARGUMENT if the key type has no domain parameters
+ `INVALID_ARGUMENT` if the key type has no domain parameters
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:25:30 -06:00
  • NOT_SUPPORTED if the implementation doesn't have code to format domain parameters
+ `NOT_SUPPORTED` if the implementation doesn't have code to format domain parameters
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:41:29 -06:00

Missing handle parameter

Missing handle parameter
@ -453,0 +484,4 @@
* ```
* - For elliptic curve public keys (key types for which
* #PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY is true), the format is the uncompressed
* representation defined by SEC1 §2.3.3 as the content of an ECPoint:
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:30:20 -06:00

“a” → “the”, and specify the length of x. There are two sensible choices: determined by the key size, or without leading zeros. DER packaging would strip leading zeros, but this leaks a fraction of a bit of information about the private key through the private key size, so I think it's better to avoid this. A fixed size is also simpler for applications. So the size of x is the private key size in bytes. (DSA private key sizes are always a multiple of 32 bits, so there are no concerns about non-byte-aligned sizes.)

“a” → “the”, and specify the length of `x`. There are two sensible choices: determined by the key size, or without leading zeros. DER packaging would strip leading zeros, but this leaks a fraction of a bit of information about the private key through the private key size, so I think it's better to avoid this. A fixed size is also simpler for applications. So the size of `x` is the private key size in bytes. (DSA private key sizes are always a multiple of 32 bits, so there are no concerns about non-byte-aligned sizes.)
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:33:51 -06:00

“a” → “the”, and specify the length of x. There are two sensible choices: determined by the key size, or without leading zeros. DER packaging would strip leading zeros, but this leaks a fraction of a bit of information about the private key through the private key size, so I think it's better to avoid this. A fixed size is also simpler for applications. So the size of x is the byte size of the subgroup prime q.

“a” → “the”, and specify the length of `x`. There are two sensible choices: determined by the key size, or without leading zeros. DER packaging would strip leading zeros, but this leaks a fraction of a bit of information about the private key through the private key size, so I think it's better to avoid this. A fixed size is also simpler for applications. So the size of `x` is the byte size of the subgroup prime `q`.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:36:35 -06:00

Like for the private key, specify the length of the string and “a” → “the”. For DSA the public key should have the same length as the base prime p.

Like for the private key, specify the length of the string and “a” → “the”. For DSA the public key should have the same length as the base prime `p`.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:36:53 -06:00

Like for the private key, specify the length of the string and “a” → “the”. For DH, like for DSA, the public key should have the same length as the base prime p.

Like for the private key, specify the length of the string and “a” → “the”. For DH, like for DSA, the public key should have the same length as the base prime `p`.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:38:33 -06:00

“y (g^x mod p)” looks like y(g^x mod p) or y × (g^x mod p). Write y = g^x mod p or “y (which is g^x mod p)” or just leave out the g^x mod p bit. Be consistent with DSA: it's the same math.

“`y` (`g^x mod p`)” looks like `y(g^x mod p)` or `y × (g^x mod p)`. Write `y = g^x mod p` or “`y` (which is `g^x mod p`)” or just leave out the `g^x mod p` bit. Be consistent with DSA: it's the same math.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 11:41:12 -06:00

What optional structure?

What optional structure?
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 12:09:05 -06:00
@ -2171,1 +2139,3 @@
* #PSA_ALG_IS_KEY_AGREEMENT(\p alg) is true).
* \param[in,out] generator The generator object to set up. It must have been
* initialized as per the documentation for
* #psa_crypto_generator_t and not yet in use.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 12:09:05 -06:00

Yes: what I wrote above. With or without the specific case of EC keys.

Yes: what I wrote above. With or without the specific case of EC keys.
Patater (Migrated from github.com) reviewed 2019-01-11 12:11:57 -06:00
Patater (Migrated from github.com) commented 2019-01-11 12:11:57 -06:00

What should be returned if the handle is invalid and the library hasn't been initialized yet? Both errors, right? :p

What should be returned if the handle is invalid and the library hasn't been initialized yet? Both errors, right? :p
Patater (Migrated from github.com) reviewed 2019-01-11 12:14:49 -06:00
Patater (Migrated from github.com) commented 2019-01-11 12:14:49 -06:00

When would we return INVALID_ARGUMENT? We'd expect to be able to call this function before we know the key type as specified during import or generate, right? So, it wouldn't be when the key type is known to not need or support key domain parameters, as we don't know the key type yet.

When would we return `INVALID_ARGUMENT`? We'd expect to be able to call this function before we know the key type as specified during import or generate, right? So, it wouldn't be when the key type is known to not need or support key domain parameters, as we don't know the key type yet.
Patater (Migrated from github.com) reviewed 2019-01-11 12:15:05 -06:00
Patater (Migrated from github.com) commented 2019-01-11 12:15:05 -06:00

How do we know the key type?

How do we know the key type?
Patater (Migrated from github.com) reviewed 2019-01-11 12:30:50 -06:00
Patater (Migrated from github.com) commented 2019-01-11 12:30:50 -06:00

The one specifying the key domain parameters and whose documentation is referenced a bit later in the entry. Do you have a suggestion to make it more clear or less confusing?

The one specifying the key domain parameters and whose documentation is referenced a bit later in the entry. Do you have a suggestion to make it more clear or less confusing?
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 12:59:05 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 12:59:05 -06:00

Oh, I see what you mean. I'm quite confident that there is no interoperability bug since Mbed TLS is able to interact with the other TLS implementations out there. The bug is partly on me for using the name ECPoint for something that is not what the applicable specifications call ECPoint, and I would say partly on SEC1 for having confusing language.

RFC 5280 defines SubjectPublicKeyInfo as containing a subjectPublicKey which is always a BIT STRING. The content of this BIT STRING depends on the key type. RFC 3279 defines the content of a subjectPublicKey for some common key types. For an RSA or DSA or DH key, the content of the BIT STRING is an ASN.1 SEQUENCE. For an EC key, SEC 1 §C.3 says (the same language appears in RFC 3279 §2.3.5):

The elliptic curve public key (an ECPoint which is an OCTET STRING) is mapped to a subjectPublicKey (a BIT STRING) as follows: the most significant bit of the OCTET STRING becomes the most significant bit of the BIT STRING, and the least significant bit of the OCTET STRING becomes the least significant bit of the BIT STRING.

What you do here is to take the content of the ECPoint and stuff it into a BIT STRING. You don't stuff the OCTET STRING (04 + length + content) into the BIT STRING. By coincidence, the content of the BIT STRING happens to start with 04 in all the data we manipulate because that's the prefix for an uncompressed point representation (SEC1 §2.3.3 action 3.3). You can argue that SEC1 is ambiguous, and I'd agree with that, but everybody including the de facto standard openssl stuffs an EC point representation into a BIT STRING and not an ECPoint into a BIT STRING.

I filed a spec bug to go through all uses of “ECPoint” and fix them.

Oh, I see what you mean. I'm quite confident that there is no interoperability bug since Mbed TLS is able to interact with the other TLS implementations out there. The bug is partly on me for using the name `ECPoint` for something that is not what the applicable specifications call `ECPoint`, and I would say partly on SEC1 for having confusing language. [RFC 5280](https://tools.ietf.org/html/rfc5280#section-4.1) defines SubjectPublicKeyInfo as containing a subjectPublicKey which is always a BIT STRING. The content of this BIT STRING depends on the key type. [RFC 3279](https://tools.ietf.org/html/rfc3279#section-2.3) defines the content of a subjectPublicKey for some common key types. For an RSA or DSA or DH key, the content of the BIT STRING is an ASN.1 SEQUENCE. For an EC key, SEC 1 §C.3 says (the same language appears in [RFC 3279 §2.3.5](https://tools.ietf.org/html/rfc3279#section-2.3.5)): > The elliptic curve public key (an ECPoint which is an OCTET STRING) is mapped to a subjectPublicKey (a BIT STRING) as follows: the most significant bit of the OCTET STRING becomes the most significant bit of the BIT STRING, and the least significant bit of the OCTET STRING becomes the least significant bit of the BIT STRING. What you do here is to take the _content_ of the ECPoint and stuff it into a BIT STRING. You don't stuff the OCTET STRING (`04` + length + content) into the BIT STRING. By coincidence, the content of the BIT STRING happens to start with `04` in all the data we manipulate because that's the prefix for an uncompressed point representation (SEC1 §2.3.3 action 3.3). You can argue that SEC1 is ambiguous, and I'd agree with that, but everybody including the de facto standard openssl stuffs an EC point representation into a BIT STRING and not an ECPoint into a BIT STRING. I filed a spec bug to go through all uses of “ECPoint” and fix them.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 13:00:31 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 13:00:31 -06:00

Unless otherwise specified, if multiple error codes apply, the implementation picks whichever it likes.

Unless otherwise specified, if multiple error codes apply, the implementation picks whichever it likes.
Patater commented 2019-01-11 13:02:01 -06:00 (Migrated from github.com)

Rebased to address code review feedback.

Rebased to address code review feedback.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 13:06:24 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 13:06:24 -06:00

That's a problem: this function needs to know how to interpret the domain parameters. It will probably want to convert the string to an internal representation. The type needs to be known at this point. The domain parameters are a sort of subtype, you can't have domain parameters (as in the mathematical object and not just some string representation with an unspecified encoding) without having the key type.

That's a problem: this function needs to know how to interpret the domain parameters. It will probably want to convert the string to an internal representation. The type needs to be known at this point. The domain parameters are a sort of subtype, you can't have domain parameters (as in the mathematical object and not just some string representation with an unspecified encoding) without having the key type.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 13:07:14 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 13:07:14 -06:00

It needs to have been specified one way or the other. See the internal spec discussion at https://github.com/ARMmbed/psa-crypto/issues/96

It needs to have been specified one way or the other. See the internal spec discussion at https://github.com/ARMmbed/psa-crypto/issues/96
Patater commented 2019-01-11 13:07:49 -06:00 (Migrated from github.com)

Rebased to remove XXX observation for ECPoint representation.

Rebased to remove XXX observation for ECPoint representation.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-11 13:11:15 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-11 13:11:15 -06:00

It's not a matter of clarity, it's a matter of completeness. You never specify what the structure is. This should probably not be a structure since psa_set_key_domain_parameters doesn't take a structure as input: it should be a buffer.

It's not a matter of clarity, it's a matter of completeness. You never specify what the structure is. This should probably not be a structure since `psa_set_key_domain_parameters` doesn't take a structure as input: it should be a buffer.
Patater (Migrated from github.com) reviewed 2019-01-11 14:13:21 -06:00
Patater (Migrated from github.com) commented 2019-01-11 14:13:21 -06:00

It's an issue with clarity, because I didn't mean structure in the C struct case. I meant in the abstract sense, so I can clarify by saying "buffer" instead of "structure".

It's an issue with clarity, because I didn't mean structure in the C struct case. I meant in the abstract sense, so I can clarify by saying "buffer" instead of "structure".
dgreen-arm (Migrated from github.com) reviewed 2019-01-14 04:30:27 -06:00
dgreen-arm (Migrated from github.com) commented 2019-01-14 04:30:27 -06:00

Handle parameter documentation is missing. Similarly for psa_set_key_domain_parameters.

Handle parameter documentation is missing. Similarly for `psa_set_key_domain_parameters`.
Patater commented 2019-01-14 04:43:22 -06:00 (Migrated from github.com)

Rebased to remove DH and DSA work, which has been raised in PR #14 instead.

Rebased to remove DH and DSA work, which has been raised in PR #14 instead.
dgreen-arm (Migrated from github.com) reviewed 2019-01-14 06:14:16 -06:00
@ -902,0 +937,4 @@
unsigned char *buf, size_t size )
{
int ret;
unsigned char *c;
dgreen-arm (Migrated from github.com) commented 2019-01-14 06:13:10 -06:00

With this change, I think most of the if( status != PSA_SUCCESS ) return( status ); code could be removed and the return( PSA_SUCCESS ) at the end changed to return( status )

The only one that needs to remain is the one in the raw byte section.

With this change, I think most of the `if( status != PSA_SUCCESS ) return( status );` code could be removed and the `return( PSA_SUCCESS )` at the end changed to `return( status )` The only one that needs to remain is the one in the raw byte section.
Patater commented 2019-01-14 07:16:26 -06:00 (Migrated from github.com)

Added a commit to refactor import, as suggested by both @gilles-peskine-arm and @dgreen-arm, making the code a bit easier to read.

Added a commit to refactor import, as suggested by both @gilles-peskine-arm and @dgreen-arm, making the code a bit easier to read.
Patater (Migrated from github.com) reviewed 2019-01-14 10:58:37 -06:00
Patater (Migrated from github.com) commented 2019-01-14 10:58:37 -06:00

Darryl suggested the same change, so I went ahead and did it.

Darryl suggested the same change, so I went ahead and did it.
dgreen-arm (Migrated from github.com) reviewed 2019-01-14 10:59:53 -06:00
dgreen-arm (Migrated from github.com) left a comment
No description provided.
There's one documentation change suggested by Gilles outstanding, but otherwise looks good to me.
Patater commented 2019-01-14 11:00:58 -06:00 (Migrated from github.com)

Added commit for documentation change suggestion from @gilles-peskine-arm

Added commit for documentation change suggestion from @gilles-peskine-arm
Patater commented 2019-01-14 11:15:43 -06:00 (Migrated from github.com)

Rebased to fix https://github.com/ARMmbed/mbed-crypto/pull/13#discussion_r247152162 in the EC format simplifying commit

Rebased to fix https://github.com/ARMmbed/mbed-crypto/pull/13#discussion_r247152162 in the EC format simplifying commit
dgreen-arm (Migrated from github.com) reviewed 2019-01-14 11:17:36 -06:00
gilles-peskine-arm (Migrated from github.com) requested changes 2019-01-14 12:33:40 -06:00
gilles-peskine-arm (Migrated from github.com) left a comment
  • See the comments in this review.
  • Missing updates in crypto_sizes.h.
* See the comments in this review. * Missing updates in `crypto_sizes.h`.
@ -448,8 +467,32 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* The output of this function can be passed to psa_import_key() to
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:46:02 -06:00

Preexisting: that's not a DER encoding and it's the content of an ECPoint, not an ECPoint.

the format is the uncompressed representation defined by SEC1 §2.3.3 as the content of an ECPoint. Let m be the bit size associated with the curve, i.e. the bit size of q for a curve over F_q. The representation consists of:

  • The byte 0x04;
  • x_P as a ceiling(m/8)-byte string, big-endian;
  • y_P as a ceiling(m/8)-byte string, big-endian.

Fixing all the misuses of ECPoint is out of scope of this PR, but please fix it in the places that you're modifying anyway.

Preexisting: that's not a DER encoding and [it's the _content_ of an ECPoint, not an ECPoint](https://github.com/ARMmbed/mbed-crypto/pull/13#discussion_r247220583). > the format is the uncompressed representation defined by SEC1 §2.3.3 as the content of an ECPoint. Let `m` be the bit size associated with the curve, i.e. the bit size of `q` for a curve over `F_q`. The representation consists of: > - The byte 0x04; > - `x_P` as a `ceiling(m/8)`-byte string, big-endian; > - `y_P` as a `ceiling(m/8)`-byte string, big-endian. Fixing all the misuses of `ECPoint` is out of scope of this PR, but please fix it in the places that you're modifying anyway.
@ -2170,2 +2139,2 @@
* (\c PSA_ALG_XXX value such that
* #PSA_ALG_IS_KEY_AGREEMENT(\p alg) is true).
* \param[in,out] generator The generator object to set up. It must have been
* initialized as per the documentation for
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:48:10 -06:00

missing formatting codes (`…` or equivalent).

missing formatting codes (`` `…` `` or equivalent).
@ -512,50 +512,112 @@ static psa_status_t psa_check_rsa_key_byte_aligned(
return( status );
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:51:35 -06:00

“any type-specific checks” is an obsolete comment that must date back from when this code also handled non-RSA. The comment should now read something like “Check that it's an RSA key”, or maybe the flow is easy enough to follow without a comment.

“any type-specific checks” is an obsolete comment that must date back from when this code also handled non-RSA. The comment should now read something like “Check that it's an RSA key”, or maybe the flow is easy enough to follow without a comment.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:52:42 -06:00

Since rsa has been lifted outside the else, might as well also lift bits and not have an else block here.

Since `rsa` has been lifted outside the `else`, might as well also lift `bits` and not have an `else` block here.
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:54:24 -06:00
/* Import a public key given as a byte string which is an uncompressed point represented as defined by SEC1 2.3.3. */
```suggestion /* Import a public key given as a byte string which is an uncompressed point represented as defined by SEC1 2.3.3. */ ```
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 11:57:13 -06:00
    /* Check that the point is on the curve. */

(“The point belongs to the group” is a mathematically correct way to phrase it but not what crypto people use in this context.)

```suggestion /* Check that the point is on the curve. */ ``` (“The point belongs to the group” is a mathematically correct way to phrase it but not what crypto people use in this context.)
@ -4075,4 +4067,3 @@
size_t *shared_secret_length )
{
mbedtls_pk_context pk;
mbedtls_ecp_keypair *their_key = NULL;
gilles-peskine-arm (Migrated from github.com) commented 2019-01-14 12:02:18 -06:00

Missing mbedtls_to_psa_error.

Why wasn't this caught by a test? I think because if we reach this point, we know that our_key is a valid key pair on a Montgomery curve and so the only possible failures are ALLOC_FAILED and HW_ACCEL_FAILED.

Missing `mbedtls_to_psa_error`. Why wasn't this caught by a test? I think because if we reach this point, we know that `our_key` is a valid key pair on a Montgomery curve and so the only possible failures are `ALLOC_FAILED` and `HW_ACCEL_FAILED`.
Patater commented 2019-01-15 04:50:02 -06:00 (Migrated from github.com)

Rebased to address code review feedback

Rebased to address code review feedback
Patater commented 2019-01-15 04:52:31 -06:00 (Migrated from github.com)

Rebased to add a few more formatting markers to psa_key_agreement() Doxygen.

Rebased to add a few more formatting markers to `psa_key_agreement()` Doxygen.
dgreen-arm (Migrated from github.com) requested changes 2019-01-15 05:24:49 -06:00
@ -448,8 +467,32 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* The output of this function can be passed to psa_import_key() to
dgreen-arm (Migrated from github.com) commented 2019-01-15 05:22:28 -06:00

Double 'the format is the'

Double 'the format is the'
Patater commented 2019-01-15 07:56:28 -06:00 (Migrated from github.com)

Rebased to fix the "the format is the the format is" problem.

Rebased to fix the "the format is the the format is" problem.
dgreen-arm (Migrated from github.com) reviewed 2019-01-16 03:29:26 -06:00
gilles-peskine-arm (Migrated from github.com) requested changes 2019-01-16 03:49:26 -06:00
gilles-peskine-arm (Migrated from github.com) left a comment

Ok for crypto.h, psa_crypto.c and the tests. Missing: updating the relevant macros and documentation in crypto_sizes.h.

Ok for `crypto.h`, `psa_crypto.c` and the tests. Missing: updating the relevant macros and documentation in `crypto_sizes.h`.
yanesca (Migrated from github.com) reviewed 2019-01-18 04:52:18 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
yanesca (Migrated from github.com) commented 2019-01-18 04:52:18 -06:00

We don't specify what implementations should/can do about the y coordinate in the case of PSA_ECC_CURVE_CURVE25519 and PSA_ECC_CURVE_CURVE448. Do we want to? I would assume that implementations simply ignore it, but are they allowed to omit it? Do we want to prescribe what is allowed if there is a parsing error on y?

We don't specify what implementations should/can do about the `y` coordinate in the case of `PSA_ECC_CURVE_CURVE25519` and `PSA_ECC_CURVE_CURVE448`. Do we want to? I would assume that implementations simply ignore it, but are they allowed to omit it? Do we want to prescribe what is allowed if there is a parsing error on `y`?
yanesca (Migrated from github.com) reviewed 2019-01-18 09:42:23 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
yanesca (Migrated from github.com) commented 2019-01-18 09:42:23 -06:00

"private key is on." -> "private key is associated with."
(The private key is an integer it is not a point it is not on any curve.)

"private key is on." -> "private key is associated with." (The private key is an integer it is not a point it is not on any curve.)
Patater (Migrated from github.com) reviewed 2019-01-21 03:29:35 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
Patater (Migrated from github.com) commented 2019-01-21 03:29:34 -06:00

What would we do with y if we had it? If we don't imagine we or any other implementations would have a use for it, we shouldn't require it.

What would we do with `y` if we had it? If we don't imagine we or any other implementations would have a use for it, we shouldn't require it.
yanesca (Migrated from github.com) reviewed 2019-01-21 04:32:22 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
yanesca (Migrated from github.com) commented 2019-01-21 04:32:21 -06:00

Some implementations might want to require it to be a specific value for robustness.

But I just realised that Montgomery curves are out of scope for 1.0:
https://github.com/ARMmbed/psa-crypto/issues/101

So we could perhaps make it explicit that Montgomery and Edwards curves are not supported yet.

@gilles-peskine-arm what would be the best way to resolve the ambiguity here?

Some implementations might want to require it to be a specific value for robustness. But I just realised that Montgomery curves are out of scope for 1.0: https://github.com/ARMmbed/psa-crypto/issues/101 So we could perhaps make it explicit that Montgomery and Edwards curves are not supported yet. @gilles-peskine-arm what would be the best way to resolve the ambiguity here?
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-21 04:47:17 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
gilles-peskine-arm (Migrated from github.com) commented 2019-01-21 04:47:17 -06:00

It's in scope for 1.0, but not for 1.0beta1. I think the 1.0 specification should define the format for Montgomery curves (and the reference implementation should support ECDH) and for Edwards curves (even if the reference implementation doesn't support them yet).

It's in scope for 1.0, but not for 1.0beta1. I think the 1.0 specification should define the format for Montgomery curves (and the reference implementation should support ECDH) and for Edwards curves (even if the reference implementation doesn't support them yet).
yanesca (Migrated from github.com) reviewed 2019-01-21 07:08:44 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
yanesca (Migrated from github.com) commented 2019-01-21 07:08:44 -06:00

In this case I suggest we define the format according to RFC8032 and RFC7748. (That is x coordinate in little endian byte order in the case of Montgomery and y coordinate in little endian byte order, with the most significant bit of the last byte set to the least significant bit of x.)

In this case I suggest we define the format according to RFC8032 and RFC7748. (That is `x` coordinate in little endian byte order in the case of Montgomery and `y` coordinate in little endian byte order, with the most significant bit of the last byte set to the least significant bit of `x`.)
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:46:40 -06:00
@ -448,8 +467,32 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* The output of this function can be passed to psa_import_key() to
hanno-becker (Migrated from github.com) commented 2019-01-21 09:46:40 -06:00

Minor: The reading flow is slightly interrupted here because it's not clear that you'll go on explaining the format. I think using a colon : instead of a full stop . after ... of an ECPoint would help.

Minor: The reading flow is slightly interrupted here because it's not clear that you'll go on explaining the format. I think using a colon `:` instead of a full stop `.` after `... of an ECPoint` would help.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:49:01 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
hanno-becker (Migrated from github.com) commented 2019-01-21 09:49:01 -06:00

Minor: Use \p.

Minor: Use `\p`.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:49:44 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
hanno-becker (Migrated from github.com) commented 2019-01-21 09:49:44 -06:00

Minor: Use \p private_key.

Minor: Use `\p private_key`.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:50:44 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
hanno-becker (Migrated from github.com) commented 2019-01-21 09:50:44 -06:00

Minor: Use \p peer_key.

Minor: Use `\p peer_key`.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:52:33 -06:00
hanno-becker (Migrated from github.com) commented 2019-01-21 09:52:33 -06:00

(Very) minor: "algorithm to compute" sounds wrong, but that might just be me as a non-native. What about "The key agreement algorithm to use."?

(Very) minor: "algorithm to compute" sounds wrong, but that might just be me as a non-native. What about "The key agreement algorithm to use."?
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:56:19 -06:00
@ -545,0 +572,4 @@
#if defined(MBEDTLS_ECP_C)
/* Import a public key given as the uncompressed representation defined by SEC1
* 2.3.3 as the content of an ECPoint. */
hanno-becker (Migrated from github.com) commented 2019-01-21 09:56:19 -06:00

Do you also want to apply a lower bound on the number of bits in the RSA modulus?

Do you also want to apply a lower bound on the number of bits in the RSA modulus?
hanno-becker (Migrated from github.com) reviewed 2019-01-21 09:57:48 -06:00
@ -549,0 +588,4 @@
return( PSA_ERROR_INSUFFICIENT_MEMORY );
mbedtls_ecp_keypair_init( ecp );
/* Load the group. */
hanno-becker (Migrated from github.com) commented 2019-01-21 09:57:48 -06:00

Note: Strictly speaking, this violates the PK API because it is assumed that apart from the RSA context within the PK context, there is no other structure worth freeing.

Note: Strictly speaking, this violates the PK API because it is assumed that apart from the RSA context within the PK context, there is no other structure worth freeing.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-21 10:02:42 -06:00
gilles-peskine-arm (Migrated from github.com) commented 2019-01-21 10:02:42 -06:00

That formulation is from me. It's copied from psa_key_derivation and will move to psa_key_derivation_setup in https://github.com/ARMmbed/mbedtls-psa/pull/244 . I'm not fond of “use” because it is very generic. “Algorithm to perform”? What do you think @Patater ?

That formulation is from me. It's copied from `psa_key_derivation` and will move to `psa_key_derivation_setup` in https://github.com/ARMmbed/mbedtls-psa/pull/244 . I'm not fond of “use” because it is very generic. “Algorithm to perform”? What do you think @Patater ?
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-21 10:05:12 -06:00
@ -545,0 +572,4 @@
#if defined(MBEDTLS_ECP_C)
/* Import a public key given as the uncompressed representation defined by SEC1
* 2.3.3 as the content of an ECPoint. */
gilles-peskine-arm (Migrated from github.com) commented 2019-01-21 10:05:12 -06:00

At the moment we're applying an upper bound in PSA to limit the amount of memory and CPU time that an operation might use. A lower bound would come from a security policy, and we don't have a minimum-key-size security policy. I'd prefer to do nothing in the PSA code for now and only follow Mbed TLS, but this isn't workable here since Mbed TLS allows unrealistiaclly large RSA key sizes.

At the moment we're applying an upper bound in PSA to limit the amount of memory and CPU time that an operation might use. A lower bound would come from a security policy, and we don't have a minimum-key-size security policy. I'd prefer to do nothing in the PSA code for now and only follow Mbed TLS, but this isn't workable here since Mbed TLS allows unrealistiaclly large RSA key sizes.
gilles-peskine-arm (Migrated from github.com) reviewed 2019-01-21 10:07:02 -06:00
@ -549,0 +588,4 @@
return( PSA_ERROR_INSUFFICIENT_MEMORY );
mbedtls_ecp_keypair_init( ecp );
/* Load the group. */
gilles-peskine-arm (Migrated from github.com) commented 2019-01-21 10:07:02 -06:00

mbedtls_pk_context is defined in pk.h, not pk_internal.h, and its fields are documented. So this assumption is validate by the documentation of pk.h, even if we might wish that the type was more opaque.

`mbedtls_pk_context` is defined in `pk.h`, not `pk_internal.h`, and its fields are documented. So this assumption is validate by the documentation of `pk.h`, even if we might wish that the type was more opaque.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 10:07:24 -06:00
hanno-becker (Migrated from github.com) commented 2019-01-21 10:07:24 -06:00

mbedtls_ecp_point_read_binary() supports the 1-Byte representation { 0x00 } of the point of infinity, but as far as I see it's not documented above. If we don't want to accept the point at infinity here, we should rule it out by e.g. checking data_length.

`mbedtls_ecp_point_read_binary()` supports the 1-Byte representation `{ 0x00 }` of the point of infinity, but as far as I see it's not documented above. If we don't want to accept the point at infinity here, we should rule it out by e.g. checking `data_length`.
hanno-becker (Migrated from github.com) reviewed 2019-01-21 10:08:12 -06:00
@ -573,6 +635,7 @@ static psa_status_t psa_import_ec_private_key( psa_ecc_curve_t curve,
ecp = mbedtls_calloc( 1, sizeof( mbedtls_ecp_keypair ) );
if( ecp == NULL )
return( PSA_ERROR_INSUFFICIENT_MEMORY );
mbedtls_ecp_keypair_init( ecp );
hanno-becker (Migrated from github.com) commented 2019-01-21 10:08:12 -06:00

Oh ok, this would fail for the point at infinity.

Oh ok, this would fail for the point at infinity.
Patater (Migrated from github.com) reviewed 2019-01-23 07:03:51 -06:00
Patater (Migrated from github.com) commented 2019-01-23 07:03:51 -06:00

Yeah, algorithm to compute sounds like you are computing an algorithm. That's second order. Can't have computers programming themselves...

"Algorithm to follow" sounds OK to me.

Yeah, algorithm to compute sounds like you are computing an algorithm. That's second order. Can't have computers programming themselves... "Algorithm to follow" sounds OK to me.
Patater (Migrated from github.com) reviewed 2019-01-23 07:05:08 -06:00
Patater (Migrated from github.com) commented 2019-01-23 07:05:08 -06:00

Won't this later get rejected during mbedtls_ecp_check_pubkey?

Won't this later get rejected during `mbedtls_ecp_check_pubkey`?
Patater (Migrated from github.com) reviewed 2019-01-23 07:05:14 -06:00
@ -573,6 +635,7 @@ static psa_status_t psa_import_ec_private_key( psa_ecc_curve_t curve,
ecp = mbedtls_calloc( 1, sizeof( mbedtls_ecp_keypair ) );
if( ecp == NULL )
return( PSA_ERROR_INSUFFICIENT_MEMORY );
mbedtls_ecp_keypair_init( ecp );
Patater (Migrated from github.com) commented 2019-01-23 07:05:13 -06:00

Yes, OK.

Yes, OK.
Patater (Migrated from github.com) reviewed 2019-01-23 07:05:36 -06:00
@ -545,0 +572,4 @@
#if defined(MBEDTLS_ECP_C)
/* Import a public key given as the uncompressed representation defined by SEC1
* 2.3.3 as the content of an ECPoint. */
Patater (Migrated from github.com) commented 2019-01-23 07:05:35 -06:00

No change planned here for this PR

No change planned here for this PR
Patater (Migrated from github.com) reviewed 2019-01-23 07:06:52 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
Patater (Migrated from github.com) commented 2019-01-23 07:06:52 -06:00

Fixed

Fixed
Patater (Migrated from github.com) reviewed 2019-01-23 07:08:49 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
Patater (Migrated from github.com) commented 2019-01-23 07:08:48 -06:00

Fixed

Fixed
Patater (Migrated from github.com) reviewed 2019-01-23 07:09:06 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
Patater (Migrated from github.com) commented 2019-01-23 07:09:06 -06:00

Fixed

Fixed
Patater (Migrated from github.com) reviewed 2019-01-23 07:11:38 -06:00
@ -448,8 +467,32 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
* The output of this function can be passed to psa_import_key() to
Patater (Migrated from github.com) commented 2019-01-23 07:11:37 -06:00

Added a colon

Added a colon
Patater (Migrated from github.com) reviewed 2019-01-23 07:12:11 -06:00
@ -2156,19 +2136,28 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
* The resulting generator always has the maximum capacity permitted by
Patater (Migrated from github.com) commented 2019-01-23 07:12:10 -06:00

Fixed

Fixed
Patater (Migrated from github.com) reviewed 2019-01-23 07:21:48 -06:00
@ -453,0 +491,4 @@
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian.
*
* For other public key types, the format is the DER representation defined by
Patater (Migrated from github.com) commented 2019-01-23 07:21:48 -06:00

Not changing format in this PR. Agreeing on a format is tracked in ARMmbed/psa-crypto#101

Not changing format in this PR. Agreeing on a format is tracked in ARMmbed/psa-crypto#101
Patater commented 2019-01-23 11:39:12 -06:00 (Migrated from github.com)

Rebased to update macros and documentation in crypto_sizes.h. Also addressed review comments from @hanno-arm

Rebased to update macros and documentation in `crypto_sizes.h`. Also addressed review comments from @hanno-arm
Patater commented 2019-01-23 11:40:42 -06:00 (Migrated from github.com)

Rebased to remove stale reference to ECPoint in crypto_sizes.h.

Rebased to remove stale reference to ECPoint in `crypto_sizes.h`.
dgreen-arm (Migrated from github.com) approved these changes 2019-01-25 04:03:56 -06:00
gilles-peskine-arm (Migrated from github.com) approved these changes 2019-01-25 04:06:29 -06:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-ARMmbed/mbed-crypto!13
No description provided.