Commit Graph

4 Commits (cute-signatures)

Author SHA1 Message Date
Aydin Mercan 962eed50db
crypto/signature: remove domain seperators for now 2022-08-24 10:16:01 +03:00
Aydin Mercan b4089b97b1
crypto/signature: remove tables
State unions and operation lists aren't really useful here.
For example, if someone wanted to have cute-only signatures, we would
need to have stubs that return unsupported only.
2022-08-24 10:15:59 +03:00
Aydin Mercan 5b020ec9ef
crypto/signature: introduce domain seperation
It might seem a bit like unnecessary bikeshedding but it shouldn't hurt
anyone.
2022-08-24 10:15:54 +03:00
Aydin Mercan 0b7d6dfbf2
crypto: start seperating public/private key usage
Digests now use bearssl + libsodium instead of openssl + libsodium.
It fits better with the API looking more similar and I don't think it
will be that much of a bottleneck.

Instead of a apk_pkey that mimicks the EVP_PKEY semantics, have seperate
public and private key structures. However, apk is broken because of it
and needs fixing. The rest of the code might compile but won't work
as I haven't handled the cases where pkey corressponds to public/private
keys in codebase properly. Also, DSA signatures are removed.

Public and private keys impls' now use a static array of vtables
internally. The indicies correspond to the signature scheme version and
checking `< APK_*_MAX` should be enough? I tried to make so that higher
values correspond to more desirable constructs, this might come in handy.

Signing/verifying start is free from keys as it isn't used though it
might be brought back for domain seperated hashes, ability to get
timestamps involved with epheremal keys in the future etc.

`apk_crypto.h` is free from openssl includes although some headers still
use them for now.
2022-08-24 10:15:14 +03:00