Skip to content

Generic de-/encoding of raw public keys via FFI (in particular for KEMs)? #4366

Answered by reneme
tobiasbrunner asked this question in Q&A
Discussion options

You must be logged in to vote

For the record: With #4373 and the (open) pull requests for SLH-DSA (#4291), ML-DSA (#4270), ML-KEM (#3893) and Classic McEliece (#3883) we introduced the algorithm-specific loading functions into the FFI (and Python-bindings):

Here's an example for ML-KEM using the FFI, the other algorithms provide equivalent functions:

botan_privkey_t sk;
botan_pubkey_t pk;

// reading of raw byte array containing an ML-KEM key pair
botan_privkey_load_ml_kem(&sk, sk_bytes, 64 /* length of sk_bytes */, "ML-KEM-768" /* ML-KEM mode */);
botan_pubkey_load_ml_kem(&pk, pk_bytes, pk_bytes_len, "ML-KEM-768" /* ML-KEM mode */);

// encoding of ML-KEM key pair into raw byte array
// (these functions aren't algori…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@reneme
Comment options

reneme Oct 11, 2024
Collaborator

@tobiasbrunner
Comment options

@reneme
Comment options

reneme Oct 14, 2024
Collaborator

@tobiasbrunner
Comment options

@reneme
Comment options

reneme Oct 14, 2024
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by reneme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants