Skip to content

Commit

Permalink
getting up-to-date with oqsprov upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
feventura committed Oct 5, 2023
1 parent 6712a3f commit 19553bc
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 88 deletions.
66 changes: 44 additions & 22 deletions oqsprov/oqs_decode_der2key.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,26 +731,48 @@ MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple,
MAKE_DECODER(, "rsa3072_sphincsshake128fsimple", rsa3072_sphincsshake128fsimple,
oqsx, SubjectPublicKeyInfo);

MAKE_DECODER("dilithium3_rsa3072", dilithium3_rsa3072, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium3_rsa3072", dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium3_p256", dilithium3_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium3_p256", dilithium3_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("falcon512_p256", falcon512_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER("falcon512_p256", falcon512_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium5_p384", dilithium5_p384, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium5_p384", dilithium5_p384, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium3_bp256", dilithium3_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium3_bp256", dilithium3_bp256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium3_ed25519", dilithium3_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium3_ed25519", dilithium3_ed25519, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium5_bp384", dilithium5_bp384, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium5_bp384", dilithium5_bp384, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium5_ed448", dilithium5_ed448, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium5_ed448", dilithium5_ed448, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("falcon512_bp256", falcon512_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER("falcon512_bp256", falcon512_bp256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("falcon512_ed25519", falcon512_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER("falcon512_ed25519", falcon512_ed25519, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER("dilithium3_pss", dilithium3_pss, oqsx, PrivateKeyInfo);
MAKE_DECODER("dilithium3_pss", dilithium3_pss, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_p256", dilithium3_p256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_p256", dilithium3_p256,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_p256", falcon512_p256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_p256", falcon512_p256,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_p384", dilithium5_p384,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_p384", dilithium5_p384,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_bp256", falcon512_bp256,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_bp256", falcon512_bp256,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512_ed25519", falcon512_ed25519,
oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_pss", dilithium3_pss,
oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_pss", dilithium3_pss,
oqsx, SubjectPublicKeyInfo);
///// OQS_TEMPLATE_FRAGMENT_DECODER_MAKE_END
132 changes: 66 additions & 66 deletions oqsprov/oqs_encode_key2any.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,70 +2051,70 @@ MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, rsa3072_sphincsshake128fsimple, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, rsa3072_sphincsshake128fsimple);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium3_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(falcon512_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(falcon512_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(falcon512_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(falcon512_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_p384, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_p384, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_p384, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium5_p384, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium3_bp256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_bp384, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_bp384, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_bp384, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium5_bp384, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_ed448, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium5_ed448, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium5_ed448, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium5_ed448, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(falcon512_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(falcon512_bp256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(falcon512_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(falcon512_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(falcon512_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_pss, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(dilithium3_pss, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(dilithium3_pss, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(dilithium3_pss, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_rsa3072, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_p256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_p384, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_p384, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium5_p384, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_bp256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_bp384, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_bp384, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium5_bp384, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_ed448, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium5_ed448, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium5_ed448, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_bp256, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, falcon512_ed25519, oqsx, SubjectPublicKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, dilithium3_pss, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, dilithium3_pss, oqsx, SubjectPublicKeyInfo, pem);
///// OQS_TEMPLATE_FRAGMENT_ENCODER_MAKE_END

0 comments on commit 19553bc

Please sign in to comment.