authenticvision / libpaseto

C implementation of Platform-Agnostic Security Tokens (PASETO)
https://paseto.io
BSD 3-Clause "New" or "Revised" License
22 stars 2 forks source link

Algorithm Lucidity #8

Open paragonie-security opened 2 years ago

paragonie-security commented 2 years ago

This wraps keys into a struct, which has a header flag. This flag is checked at runtime.

KeyHeader is an enum. The least significant bit holds purpose (Local = 0, Public = 1); the remaining are reserved for the version. This results in the following pattern:

See #7

paragonie-security commented 2 years ago

(This is a draft until we're confident that we didn't screw anything up.)

minus7 commented 2 years ago

Thanks for the PR. Here's some feedback: