Skip to content

Investigate interfacing to a defined subset of PSA Crypto #72

Open
@hug-dev

Description

@hug-dev

The PSA Crypto API has some implementation-defined parts. For example, output size macros and various types need to be defined by the implementor.
The consequence of that are:

  • the header file of the PSA Crypto implementation needs to be given as an input of this crate to generate the bindings
  • bindings can not be pre-generated
  • dynamic loading is impossible

A solution to investigate would be for us to define a subset PSA Crypto API where:

  • all functions are defined but return PSA_ERROR_NOT_SUPPORTED if not implementend
  • the key types and algorithms are limited to only the ones defined within the API (no extension)
  • the output macro are implemented (they can be with the constraint above)
  • the types are implemented, probably with void * pointer

We could implement all this in a header file, in this repo that we produce bindings from.

On the PSA Crypto implementors side, there will be a need to write a wrapper implementing our subset with the available functions.
In an ideal world, we could imagine a compilation option on the implementor project to produce a .a or .so which implements the subset instead of the original API. Then people will need to use that with Parsec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlargeEffort label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions