Update documentation at repo root #493

Merged
ronald-cron-arm merged 32 commits from root-documentation into release/tf-psa-crypto1.0.0-documentation 2025-10-07 04:43:01 -05:00
ronald-cron-arm commented 2025-10-02 08:23:37 -05:00 (Migrated from github.com)

Description

Address https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/333

PR checklist

  • changelog not required because: only updating documentation
  • framework PR not required
  • mbedtls development PR not required because: TF-PSA-Crypto only documentation
  • mbedtls 3.6 PR not required because: development only
  • tests not required because: only updating documentation
## Description Address https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/333 ## PR checklist - [x] **changelog** not required because: only updating documentation - [x] **framework PR** not required - [x] **mbedtls development PR** not required because: TF-PSA-Crypto only documentation - [x] **mbedtls 3.6 PR** not required because: development only - **tests** not required because: only updating documentation
bjwtaylor (Migrated from github.com) reviewed 2025-10-02 08:23:37 -05:00
gilles-peskine-arm (Migrated from github.com) requested changes 2025-10-03 10:00:30 -05:00
gilles-peskine-arm (Migrated from github.com) left a comment

Mostly LGTM, but there are small inaccuracies in a few places. I also left some minor optional comments.

Mostly LGTM, but there are small inaccuracies in a few places. I also left some minor optional comments.
@ -10,6 +10,7 @@ More details on all of these points may be found in the sections below.
- [Sign-off](#license-and-copyright): all commits must be signed off.
- [Tests](#tests): please ensure the PR includes adequate tests.
- [Changelog](#documentation): if needed, please provide a changelog entry.
- [Backports](#long-term-support-branches): provide a backport if needed (it's fine to wait until the main PR is accepted).
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 07:54:47 -05:00

At least BRANCHES.md, and probably CONTRIBUTING.md as well, should list Mbed TLS 3.6 as a long-time support branch. It is relevant for backporting bug fixes.

At least `BRANCHES.md`, and probably `CONTRIBUTING.md` as well, should list Mbed TLS 3.6 as a long-time support branch. It is relevant for backporting bug fixes.
@ -29,0 +32,4 @@
The project aims to minimise the impact on users upgrading to newer versions of the library and it should not be necessary for a user to make any changes to their own code to work with a newer version of the library. Unless the user has made an active decision to use newer features, a newer generation of the library or a change has been necessary due to a security issue or other significant software defect, no modifications to their own code should be necessary. To achieve this, API compatibility is maintained between different versions of TF-PSA-Crypto on the main development branch and in LTS (Long Term Support) branches, as described in [BRANCHES.md](BRANCHES.md).
To minimise such disruption to users, where a change to the interface is required, all changes to the ABI or API, even on the main development branch where new features are added, need to be justifiable by either being a significant enhancement, new feature or bug fix which is best resolved by an interface change. If there is an API change, the contribution, if accepted, will be merged only when there is a major release.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:30:00 -05:00

Preexisting for 3.6: should we mention submodules here? If you need to change something in a submodule, you'll need to make multiple pull requests. But that may be too much information here.

Also applies in Mbed TLS.

Preexisting for 3.6: should we mention submodules here? If you need to change something in a submodule, you'll need to make multiple pull requests. But that may be too much information here. Also applies in Mbed TLS.
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:01:06 -05:00

I don't think the section on the PSA API should come before the general overview of TF-PSA-Crypto. It should come after, and quite possibly doesn't belong here.

I don't think the section on the PSA API should come before the general overview of TF-PSA-Crypto. It should come after, and quite possibly doesn't belong here.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:03:01 -05:00
   (see docs/proposed/psa-conditional-inclusion-c.md) that specify which parts of the PSA

That's assuming we reference the document at all. It's intended as an architectural specification, not as user documentation.

```suggestion (see docs/proposed/psa-conditional-inclusion-c.md) that specify which parts of the PSA ``` That's assuming we reference the document at all. It's intended as an architectural specification, not as user documentation.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:08:13 -05:00

“implementation of the PSA driver interface” is a really weird way of describing this part, and psa-driver-interface.md is not relevant here. At first, when I read this sentence, I didn't understand what this section was about. I would call it something like “configuration of non-functional aspects of built-in cryptographic mechasnisms such as performance/size trade-offs”.

“implementation of the PSA driver interface” is a really weird way of describing this part, and `psa-driver-interface.md` is not relevant here. At first, when I read this sentence, I didn't understand what this section was about. I would call it something like “configuration of non-functional aspects of built-in cryptographic mechasnisms such as performance/size trade-offs”.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:48:23 -05:00

“core” is highly specific jargon, and the PSA driver interface specification is not relevant here other than being the one place that uses the word “core”. We should not reference psa-driver-interface.md because it's been adopted by PSA and we should probably remove our copy. There are currently no options related to driver dispatch. Suggested wording:

PSA core: configuration of components other than cryptographic mechanisms, such as key management and random number generation.

We may or may not also list client-server separation. That would make the list of topics complete, but client-server separation is experimental and requires a lot of third-party code, so I don't think we should mention it casually.

“core” is highly specific jargon, and the PSA driver interface specification is not relevant here other than being the one place that uses the word “core”. We should not reference `psa-driver-interface.md` because it's been adopted by PSA and [we should probably remove our copy](https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/462). There are currently no options related to driver dispatch. Suggested wording: > PSA core: configuration of components other than cryptographic mechanisms, such as key management and random number generation. We may or may not also list client-server separation. That would make the list of topics complete, but client-server separation is experimental and requires a lot of third-party code, so I don't think we should mention it casually.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:54:55 -05:00

If we continue linking to the driver interface specification, this should probably be a relative link since it's in the same project.

I think we should remove our copy of the driver interface specification since it's been adopted by PSA, but the document is still in the 1.0 release so we can keep existing references for now.

If we continue linking to the driver interface specification, this should probably be a relative link since it's in the same project. I think we should [remove our copy of the driver interface specification](https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/462/files#r2402011529) since it's been adopted by PSA, but the document is still in the 1.0 release so we can keep existing references for now.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:55:21 -05:00

This should probably be a relative link.

This should probably be a relative link.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:59:02 -05:00

Should we link to version 1.2?

[PSA Cryptography API version 1.2](https://arm-software.github.io/psa-api/crypto/1.2/)
Should we link to version 1.2? ```suggestion [PSA Cryptography API version 1.2](https://arm-software.github.io/psa-api/crypto/1.2/) ```
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:00:13 -05:00

Minor: In version 1.2, PAKE is an extension in a separate document, so I suggest

with the limitation that the implementation of the [PAKE extension](https://arm-software.github.io/psa-api/crypto/1.2/ext-pake/) still
Minor: In version 1.2, PAKE is an extension in a separate document, so I suggest ```suggestion with the limitation that the implementation of the [PAKE extension](https://arm-software.github.io/psa-api/crypto/1.2/ext-pake/) still ```
@ -30,2 +79,4 @@
1. Built-in drivers: Options to configure non-functional aspects of built-in
cryptographic mechanisms such as performance/size trade-offs.
The file `include/psa/crypto_config.h` can be edited manually, or in a more
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 08:51:14 -05:00

I think the order here looks messy (why aren't PSA mechanisms and non-PSA mechanisms next to each other? Why isn't performance compromises next to mechanism selections? etc.). But it follows the order in crypto_config.h and I think that's the right thing to do in the readme. I'd like to change the order of sections, but after the release.

I think the order here looks messy (why aren't PSA mechanisms and non-PSA mechanisms next to each other? Why isn't performance compromises next to mechanism selections? etc.). But it follows the order in `crypto_config.h` and I think that's the right thing to do in the readme. I'd like to change the order of sections, but after the release.
@ -50,3 +101,4 @@
* `apidoc/modules.html` or `apidoc/topics.html`
Compiling
---------
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:04:29 -05:00

In recent versions of Doxygen, modules.html has been renamed to topics.html. For Ubuntu, the change came between 22.04 and 24.04. So I think at this time we should mention both files.

In recent versions of Doxygen, `modules.html` [has been renamed](https://github.com/doxygen/doxygen/issues/3319#issuecomment-1720923984) to `topics.html`. For Ubuntu, the change came between 22.04 and 24.04. So I think at this time we should mention both files.
@ -68,1 +118,4 @@
Clang 3.8 and Arm Compiler 6.21. More recent versions should work. Slightly
older versions may work.
* Python 3.8 or later to generate some source files (see below), the test
code, and to generate sample programs.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:13:54 -05:00

According to https://pkgs.org/search/?q=cmake the version in CentOS 9 is 3.20.2, but the version in Rocky Linux 9 is 3.26.5. I don't know about RHEL 9 (I can't find the official package anywhere public). Given that it's only a matter of “support ecosystem changes and/or fix regressions” I think we could state 3.20.2 just in case.

According to https://pkgs.org/search/?q=cmake the version in CentOS 9 is 3.20.2, but the version in Rocky Linux 9 is 3.26.5. I don't know about RHEL 9 (I can't find the official package anywhere public). Given that it's only a matter of [“support ecosystem changes and/or fix regressions”](https://cmake.org/cmake/help/latest/release/3.20.html#id4) I think we could state 3.20.2 just in case.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:17:19 -05:00

Minor: you don't need two versions of Python.

* Python 3.8 or later to generate some source files (see below), the test
Minor: you don't need two versions of Python. ```suggestion * Python 3.8 or later to generate some source files (see below), the test ```
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:18:49 -05:00

Perl is no longer needed for building TF-PSA-Crypto. It's still used in some test scripts, and to generate some files in Mbed TLS.

Perl is no longer needed for building TF-PSA-Crypto. It's still used in some test scripts, and to generate some files in Mbed TLS.
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:52:14 -05:00
  Clang 3.8 and Arm Compiler 6.21. More recent versions should work. Slightly older versions may work.
```suggestion Clang 3.8 and Arm Compiler 6.21. More recent versions should work. Slightly older versions may work. ```
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 09:56:15 -05:00

system-wide or in a virtual environment (which is what pip strongly recommends over --user).

system-wide or in a virtual environment (which is what pip strongly recommends over `--user`).
@ -4,17 +4,17 @@ The examples are generally focused on a particular usage case (eg, support for
a restricted number of cryptographic mechanisms) and aim at minimizing resource
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 07:39:41 -05:00

Minor: it would be nice to do an out-of-tree build, which would illustrate that the path is relative to the source tree, not to the build tree. Also, it would be nice to use an actual example. For example:

   cmake -DTF_PSA_CRYPTO_CONFIG_FILE="configs/crypto-config-ccm-aes-sha256.h" -B build-ccmonly
   make -C build-ccmonly

P.S. I really like the fact that our build system supports this now!

Minor: it would be nice to do an out-of-tree build, which would illustrate that the path is relative to the source tree, not to the build tree. Also, it would be nice to use an actual example. For example: ```suggestion cmake -DTF_PSA_CRYPTO_CONFIG_FILE="configs/crypto-config-ccm-aes-sha256.h" -B build-ccmonly make -C build-ccmonly ``` P.S. I really like the fact that our build system supports this now!
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 07:46:14 -05:00

AFAIK what's in pre-push.sh works on macOS if you have the right software installed (uncrustify, precise versions of pylint and mypy (which requires an old version of Python), doxygen...). They should work on macOS, FreeBSD, etc. The only GNU requirement is bash, which is widely available on non-GNU OSes (and last I checked, the ancient bash on macOS was good enough for all.sh).

AFAIK what's in `pre-push.sh` works on macOS if you have the right software installed (uncrustify, precise versions of pylint and mypy (which requires an old version of Python), doxygen...). They should work on macOS, FreeBSD, etc. The only GNU requirement is bash, which is widely available on non-GNU OSes (and last I checked, the ancient bash on macOS was good enough for `all.sh`).
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 07:41:56 -05:00

Minor: Only if this has actually been set as a git hook, which is not explained inside this file. The paragraph here makes it look like this will happen automatically

Minor: Only if this has actually been set as a git hook, which is not explained inside this file. The paragraph here makes it look like this will happen automatically
gilles-peskine-arm (Migrated from github.com) commented 2025-10-03 07:43:16 -05:00

I don't think this is a useful set of pre-push checks. I won't block this PR, but I would prefer any work on git hook scripts not to be in an urgent pre-release PR whose purpose is to improve documentation.

I don't think this is a useful set of pre-push checks. I won't block this PR, but I would prefer any work on git hook scripts not to be in an urgent pre-release PR whose purpose is to improve documentation.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 01:34:35 -05:00
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 01:34:35 -05:00

I have removed that file.

I have removed that file.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 01:35:00 -05:00
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 01:35:00 -05:00

That's fair enough. I have removed it.

That's fair enough. I have removed it.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 01:35:27 -05:00
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 01:35:27 -05:00

File removed.

File removed.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 02:25:41 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 02:25:41 -05:00

I've removed the first paragraph about PSA in general and changed sub-section titles.

I've removed the first paragraph about PSA in general and changed sub-section titles.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 02:27:49 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 02:27:49 -05:00

I've removed the reference.

I've removed the reference.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 02:46:56 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 02:46:56 -05:00

I've kept the reference for the time being.

I've kept the reference for the time being.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 03:04:03 -05:00
@ -68,1 +118,4 @@
Clang 3.8 and Arm Compiler 6.21. More recent versions should work. Slightly
older versions may work.
* Python 3.8 or later to generate some source files (see below), the test
code, and to generate sample programs.
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 03:04:03 -05:00

Removed

Removed
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 03:51:34 -05:00
@ -29,0 +32,4 @@
The project aims to minimise the impact on users upgrading to newer versions of the library and it should not be necessary for a user to make any changes to their own code to work with a newer version of the library. Unless the user has made an active decision to use newer features, a newer generation of the library or a change has been necessary due to a security issue or other significant software defect, no modifications to their own code should be necessary. To achieve this, API compatibility is maintained between different versions of TF-PSA-Crypto on the main development branch and in LTS (Long Term Support) branches, as described in [BRANCHES.md](BRANCHES.md).
To minimise such disruption to users, where a change to the interface is required, all changes to the ABI or API, even on the main development branch where new features are added, need to be justifiable by either being a significant enhancement, new feature or bug fix which is best resolved by an interface change. If there is an API change, the contribution, if accepted, will be merged only when there is a major release.
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 03:51:34 -05:00

Not added for the time being.

Not added for the time being.
ronald-cron-arm commented 2025-10-06 04:18:45 -05:00 (Migrated from github.com)

@davidhorstmann-arm @gilles-peskine-arm I believe I have addressed all comments, please have another look.

@davidhorstmann-arm @gilles-peskine-arm I believe I have addressed all comments, please have another look.
gilles-peskine-arm (Migrated from github.com) reviewed 2025-10-06 04:42:43 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
gilles-peskine-arm (Migrated from github.com) commented 2025-10-06 04:42:43 -05:00

I still think the order is wrong, but that's not a blocker.

I still think the order is wrong, but that's not a blocker.
gilles-peskine-arm (Migrated from github.com) approved these changes 2025-10-06 04:45:31 -05:00
gilles-peskine-arm (Migrated from github.com) left a comment

LGTM

I still think the order of sections in README.md could be improved but that's not a blocker.

LGTM I still [think the order of sections in `README.md` could be improved](https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/493#discussion_r2405516690) but that's not a blocker.
ronald-cron-arm (Migrated from github.com) reviewed 2025-10-06 04:47:06 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
ronald-cron-arm (Migrated from github.com) commented 2025-10-06 04:47:06 -05:00

I was not sure about what you meant about the order. I thought your comment was about the presentation of the PSA API in general. Thus where would you move the "PSA Cryptography API" section?

I was not sure about what you meant about the order. I thought your comment was about the presentation of the PSA API in general. Thus where would you move the "PSA Cryptography API" section?
gilles-peskine-arm (Migrated from github.com) reviewed 2025-10-06 04:57:03 -05:00
@ -2,38 +2,89 @@ README for TF-PSA-Crypto
========================
gilles-peskine-arm (Migrated from github.com) commented 2025-10-06 04:57:03 -05:00

This readme is for TF-PSA-Crypto, which is a library. This library implements a standard, the PSA Crypto API. The readme should first present the product, and then have a section on the API. The presentation of the product should not assume that readers are already familiar with the API.

So I would open with a general overview of the functionality (cryptographic operations, random generation, key store, key parsing and formatting) with a mention that most of the API is the PSA Crypto API, with a link to the section that describes the API.

Then I think practical considerations such as configuration, compiling, etc. should come before the section on the PSA API.

Also, while we're discussing section ordering, I think compilation should come immediately after configuration. Documentation should probably come before those, and example programs should be next to or part of documentation.

But none of that is a release blocker, so I propose to do another pass on the readme after the release.

This readme is for TF-PSA-Crypto, which is a library. This library implements a standard, the PSA Crypto API. The readme should first present the product, and then have a section on the API. The presentation of the product should not assume that readers are already familiar with the API. So I would open with a general overview of the functionality (cryptographic operations, random generation, key store, key parsing and formatting) with a mention that most of the API is the PSA Crypto API, with a link to the section that describes the API. Then I think practical considerations such as configuration, compiling, etc. should come before the section on the PSA API. Also, while we're discussing section ordering, I think compilation should come immediately after configuration. Documentation should probably come before those, and example programs should be next to or part of documentation. But none of that is a release blocker, so I propose to do another pass on the readme after the release.
davidhorstmann-arm (Migrated from github.com) requested changes 2025-10-06 09:56:25 -05:00
davidhorstmann-arm (Migrated from github.com) left a comment

A few small things, looks good otherwise.

Apologies for the delayed turnaround.

A few small things, looks good otherwise. Apologies for the delayed turnaround.
@ -60,37 +112,71 @@ You need the following tools to build the library from the main branch with the
provided CMake files. TF-PSA-Crypto minimum tool version requirements are set
davidhorstmann-arm (Migrated from github.com) commented 2025-10-06 09:52:14 -05:00

Nit:

The supported branches (see [`BRANCHES.md`](BRANCHES.md)) use a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules#_cloning_submodules),
Nit: ```suggestion The supported branches (see [`BRANCHES.md`](BRANCHES.md)) use a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules#_cloning_submodules), ```
@ -105,8 +191,8 @@ In order to run the tests, enter:
davidhorstmann-arm (Migrated from github.com) commented 2025-10-06 09:53:16 -05:00

Nit:

The test suites need Python to be built. If you don't have Python installed,
Nit: ```suggestion The test suites need Python to be built. If you don't have Python installed, ```
gilles-peskine-arm (Migrated from github.com) approved these changes 2025-10-06 11:20:34 -05:00
gilles-peskine-arm (Migrated from github.com) left a comment

LGTM

LGTM
davidhorstmann-arm (Migrated from github.com) approved these changes 2025-10-07 04:39:52 -05:00
davidhorstmann-arm (Migrated from github.com) left a comment

LGTM, thanks!

LGTM, thanks!
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-Mbed-TLS/TF-PSA-Crypto!493
No description provided.