Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
67cf7a7
In between PR for folder structure (#1)
HeHa112 Jul 7, 2026
eabb09f
Merge branch 'eclipse-score:main' into main
HeHa112 Jul 7, 2026
a29aa95
Merge branch 'eclipse-score:main' into main
HeHa112 Jul 7, 2026
1249997
Merge branch 'eclipse-score:main' into main
HeHa112 Jul 8, 2026
4bf8ccd
Start to fix documentation run
HeHa112 Jul 7, 2026
30d4e21
Continue with "Build Documentation" fix
HeHa112 Jul 8, 2026
6d506a9
Continue with "Build Documentation" fix, requirements.rst
HeHa112 Jul 8, 2026
52bc10b
Start to fix documentation run (#2)
HeHa112 Jul 8, 2026
af2a026
Update after review
HeHa112 Jul 10, 2026
044ac31
Merge pull request #3 from iavofficial/feature/add_component_folder_s…
CPelka34 Jul 10, 2026
770e076
Merge branch 'eclipse-score:main' into main
HeHa112 Jul 15, 2026
56d467a
Merge branch 'eclipse-score:main' into main
HeHa112 Jul 17, 2026
36e64ff
Merge branch 'eclipse-score:main' into main
EmbeddedSwGuy Jul 24, 2026
ba7e309
Merge branch 'eclipse-score:main' into main
CPelka34 Aug 4, 2026
4ed6693
Merge branch 'eclipse-score:main' into main
HeHa112 Aug 13, 2026
d94ec22
Merge branch 'eclipse-score:main' into main
HeHa112 Aug 18, 2026
00ddb6b
Merge branch 'eclipse-score:main' into main
HeHa112 Aug 19, 2026
d1904de
Fix "PR Checks" action (#4)
HeHa112 Aug 20, 2026
1f465fe
Merge branch 'eclipse-score:main' into main
HeHa112 Aug 24, 2026
6ee6ace
Merge branch 'eclipse-score:main' into main
HeHa112 Aug 25, 2026
207f64a
iav_primula: bazel lockfile update
HeHa112 Aug 25, 2026
d432650
iav_primula: bazel lockfile update (#6)
HeHa112 Aug 25, 2026
ce44306
Merge remote-tracking branch 'upstream/main'
HeHa112 Aug 27, 2026
64e9e2e
Bump openssl from 0.10.68 to 0.10.80 in /score/cryptoki
dependabot[bot] Aug 27, 2026
cd66cb4
Merge pull request #7 from iavofficial/dependabot/cargo/score/cryptok…
HeHa112 Aug 27, 2026
0042cc7
Merge branch 'eclipse-score:main' into main
HeHa112 Sep 1, 2026
ddb318a
iav_primula: update MODULE.bazel.lock
HeHa112 Sep 1, 2026
99ca4e3
Merge pull request #8 from iavofficial/fix/gh-actions
HeHa112 Sep 1, 2026
ac7da95
iav_primula: add first integration dummy
HeHa112 Sep 3, 2026
c1c1342
Merge branch 'eclipse-score:main' into main
HeHa112 Sep 7, 2026
31499c9
Dependabot openssl adjustment cancelled (#11)
HeHa112 Sep 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion score/crypto/src/backend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool_flag(

bool_flag(
name = "score_crypto_score_primula_enabled",
build_setting_default = False,
build_setting_default = True,
visibility = ["//visibility:public"],
)

Expand Down
2 changes: 1 addition & 1 deletion score/crypto/src/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Backend enable/disable is controlled via `bool_flag` targets. All flags are in
| `score_crypto_pkcs11_backend_enabled` | `True` | `--//score/crypto/src/backend:score_crypto_pkcs11_backend_enabled=False` |
| `score_crypto_score_backend_enabled` | `True` | `--//score/crypto/src/backend:score_crypto_score_backend_enabled=False` |
| `score_crypto_score_openssl_enabled` | `True` | `--//score/crypto/src/backend:score_crypto_score_openssl_enabled=False` |
| `score_crypto_score_primula_enabled` | `False` | `--//score/crypto/src/backend:score_crypto_score_primula_enabled=True` |
| `score_crypto_score_primula_enabled` | `True` | `--//score/crypto/src/backend:score_crypto_score_primula_enabled=False` |

`score_crypto_score_backend_enabled` is the master gate for the score provider
Individual sub-backend flags (`score_crypto_score_openssl_enabled`, etc.) have
Expand Down
14 changes: 12 additions & 2 deletions score/crypto/src/backend/score_provider/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ cc_library(
"//score/crypto/src/daemon/provider/score_provider:score_backend_adapter",
"//score/crypto/src/backend/score_provider/openssl:openssl_backend_define",
# To add a new score backend: add its *_backend_define dep here (step 3).
],
] + select({
"//score/crypto/src/backend:primula_backend_active": [
"//score/crypto/src/backend/score_provider/iav_primula:primula_backend_define",
],
"//conditions:default": [],
}),
)

# Heavy: aggregates all active sub-backend adapter targets.
Expand All @@ -72,5 +77,10 @@ cc_library(
deps = [
"//score/crypto/src/backend/score_provider/openssl:openssl_backend",
# To add a new score backend: add its *_backend dep here (step 4).
],
] + select({
"//score/crypto/src/backend:primula_backend_active": [
"//score/crypto/src/backend/score_provider/iav_primula:primula_backend",
],
"//conditions:default": [],
}),
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif

#ifdef SCORE_BACKEND_PRIMULA_ENABLED
#include "score/crypto/src/backend/score_provider/primula/primula_backend_adapter.hpp"
#include "score/crypto/src/backend/score_provider/iav_primula/primula_backend_adapter.hpp"
#endif

namespace score::crypto::backend::score_provider
Expand Down
39 changes: 39 additions & 0 deletions score/crypto/src/backend/score_provider/iav_primula/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "primula_backend_adapter",
srcs = ["primula_backend_adapter.cpp"],
hdrs = ["primula_backend_adapter.hpp"],
target_compatible_with = select({
"//score/crypto/src/backend:primula_backend_active": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
visibility = ["//score/crypto/src/backend/score_provider:__pkg__"],
deps = [
"//score/crypto/src/daemon/provider/score_provider:score_backend_adapter",
"//score/crypto/src/daemon/provider/score_provider:provider_iav_primula_library",
],
)

cc_library(
name = "primula_backend_define",
defines = ["SCORE_BACKEND_PRIMULA_ENABLED=1"],
target_compatible_with = select({
"//score/crypto/src/backend:primula_backend_active": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
visibility = [
"//score/crypto/src/backend:__pkg__",
"//score/crypto/src/backend/score_provider:__pkg__",
],
)

cc_library(
name = "primula_backend",
target_compatible_with = select({
"//score/crypto/src/backend:primula_backend_active": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
visibility = ["//score/crypto/src/backend/score_provider:__pkg__"],
deps = [":primula_backend_adapter", ":primula_backend_define"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#include "primula_backend_adapter.hpp"

#include "score/crypto/src/daemon/provider/score_provider/iav_primula/iav_primula_provider.hpp"

namespace score::crypto::backend::score_provider::primula
{

daemon::provider::score_provider::ProviderCreator PrimulaBackendAdapter::GetProviderCreator() const
{
using namespace daemon::provider::score_provider;

return ProviderCreator{
.backend_id = "primula",
.backend_name = "PRIMULA",
// IAV-Primula provides post-quantum algorithms only. Mark it as SPECIALIZED
// so that it is not selected for generic SOFTWARE algorithms such as SHA-256
// or HMAC, which are provided by OpenSSL.
.provider_type = "SPECIALIZED",
.create_provider = []() -> std::unique_ptr<daemon::provider::IProvider> {
return std::make_unique<daemon::provider::score_provider::iav_primula::IavPrimulaProvider>();
}};
}

} // namespace score::crypto::backend::score_provider::primula
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

/// @file primula_backend_adapter.hpp
/// @brief Backend adapter for the IAV-Primula score provider.

#ifndef SCORE_CRYPTO_SRC_BACKEND_PROVIDER_IAV_PRIMULA_ADAPTER_HPP
#define SCORE_CRYPTO_SRC_BACKEND_PROVIDER_IAV_PRIMULA_ADAPTER_HPP

#include "score/crypto/src/daemon/provider/score_provider/score_backend_adapter.hpp"

namespace score::crypto::backend::score_provider::primula
{

/// @brief IAV-Primula backend adapter for the score provider family.
///
/// Provides factory creation metadata for the IAV-Primula post-quantum
/// crypto backend. This adapter is included at compile time via
/// backend/score_provider/active_backends_list.hpp when the Primula backend
/// is enabled in the Bazel configuration.
///
/// The IAV-Primula backend implementation lives in:
/// - daemon/provider/score_provider/iav_primula/iav_primula_provider.*
/// - daemon/provider/score_provider/iav_primula/operations/*
///
/// This adapter provides backend metadata and creates the corresponding
/// provider instance. Cryptographic operations are implemented by the
/// IAV-Primula provider and its handlers.
class PrimulaBackendAdapter final : public daemon::provider::score_provider::IBackendProviderAdapter
{
public:
PrimulaBackendAdapter() = default;
~PrimulaBackendAdapter() override = default;

PrimulaBackendAdapter(const PrimulaBackendAdapter&) = delete;
PrimulaBackendAdapter& operator=(const PrimulaBackendAdapter&) = delete;
PrimulaBackendAdapter(PrimulaBackendAdapter&&) = delete;
PrimulaBackendAdapter& operator=(PrimulaBackendAdapter&&) = delete;

/// @brief Get the provider creator for the IAV-Primula backend.
///
/// Returns:
/// - backend_id: "primula"
/// - backend_name: "PRIMULA"
/// - provider_type: "SPECIALIZED"
/// - create_provider: constructs and returns an IavPrimulaProvider
[[nodiscard]] daemon::provider::score_provider::ProviderCreator GetProviderCreator() const override;
};

} // namespace score::crypto::backend::score_provider::primula

#endif // SCORE_CRYPTO_SRC_BACKEND_PROVIDER_IAV_PRIMULA_ADAPTER_HPP
3 changes: 3 additions & 0 deletions score/crypto/src/daemon/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ cc_library(
"//score/crypto/src/daemon/key_management:key_management_operations",
"//score/crypto/src/daemon/provider/handler:hash_handler_operations",
"//score/crypto/src/daemon/provider/handler:mac_handler_operations",
"//score/crypto/src/daemon/provider/handler:sign_handler_operations",
"//score/crypto/src/daemon/provider/handler:verify_handler_operations",
"//score/crypto/src/daemon/provider/handler:kem_handler_operations",
"@score_baselibs//score/mw/log",
],
)
3 changes: 3 additions & 0 deletions score/crypto/src/daemon/common/actors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inline constexpr OperationActor OP_ACTOR_PROVIDER = 3;
inline constexpr OperationActor OP_ACTOR_HASH_HANDLER = 4;
inline constexpr OperationActor OP_ACTOR_KEY_MANAGEMENT = 5;
inline constexpr OperationActor OP_ACTOR_MAC_HANDLER = 6;
inline constexpr OperationActor OP_ACTOR_SIGN_HANDLER = 7;
inline constexpr OperationActor OP_ACTOR_VERIFY_HANDLER = 8;
inline constexpr OperationActor OP_ACTOR_KEM_HANDLER = 9;

// Starting point for custom actors
inline constexpr OperationActor CUSTOM_ACTOR_START = 1 << (std::numeric_limits<OperationActor>::digits - 1);
Expand Down
79 changes: 73 additions & 6 deletions score/crypto/src/daemon/common/algorithm_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#ifndef SCORE_CRYPTO_SRC_DAEMON_COMMON_ALGORITHM_INFO_HPP
#define SCORE_CRYPTO_SRC_DAEMON_COMMON_ALGORITHM_INFO_HPP

#include <array>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string_view>

Expand All @@ -31,14 +33,14 @@ struct HashAlgorithmInfo
std::size_t digest_size; ///< Output size in bytes
};

inline constexpr HashAlgorithmInfo kHashAlgorithms[] = {
inline constexpr std::array<HashAlgorithmInfo, 6UL> kHashAlgorithms{{
{"SHA256", 32U},
{"SHA384", 48U},
{"SHA512", 64U},
{"SHA224", 28U},
{"SHA1", 20U},
{"MD5", 16U},
};
}};

/// @brief Look up digest size by algorithm name.
/// @return digest size in bytes, or std::nullopt if unknown.
Expand All @@ -64,11 +66,11 @@ struct MacAlgorithmInfo
std::size_t mac_size; ///< Output tag size in bytes
};

inline constexpr MacAlgorithmInfo kMacAlgorithms[] = {
inline constexpr std::array<MacAlgorithmInfo, 3UL> kMacAlgorithms = {{
{"HMAC-SHA256", 32U},
{"HMAC-SHA384", 48U},
{"HMAC-SHA512", 64U},
};
}};

/// @brief Look up MAC output size by algorithm name.
/// @return MAC size in bytes, or std::nullopt if unknown.
Expand All @@ -94,7 +96,72 @@ struct KeyAlgorithmInfo
std::size_t key_size; ///< Default key size in bytes
};

inline constexpr KeyAlgorithmInfo kKeyAlgorithms[] = {
// ---------------------------------------------------------------------------
// Post-quantum algorithm properties
// ---------------------------------------------------------------------------

/// @brief Identifies the operation family implemented by a PQC algorithm.
enum class PqcAlgorithmKind : std::uint8_t
{
kSignature,
kKem,
};

/// @brief Fixed-size properties for standardized PQC parameter sets.
///
/// The sizes describe the byte representation used at the provider boundary.
/// The provider remains responsible for validating the actual encoding.
struct PqcAlgorithmInfo
{
std::string_view name; ///< Standardized algorithm identifier.
PqcAlgorithmKind kind; ///< Signature or KEM algorithm.
std::size_t public_key_size; ///< Public key size in bytes.
std::size_t private_key_size; ///< Private key size in bytes.
std::size_t signature_or_ciphertext_size; ///< Signature or ciphertext size in bytes; zero when not applicable.
std::size_t shared_secret_size; ///< Shared-secret size in bytes; zero for signature algorithms.
};

inline constexpr std::array<PqcAlgorithmInfo, 6UL> kPqcAlgorithms = {{
// ML-DSA: public key, private key, and signature sizes from FIPS 204.
{"ML-DSA-44", PqcAlgorithmKind::kSignature, 1312U, 2560U, 2420U, 0U},
{"ML-DSA-65", PqcAlgorithmKind::kSignature, 1952U, 4032U, 3309U, 0U},
{"ML-DSA-87", PqcAlgorithmKind::kSignature, 2592U, 4896U, 4627U, 0U},

// ML-KEM: public key, private key, ciphertext, and shared-secret sizes
// from FIPS 203.
{"ML-KEM-512", PqcAlgorithmKind::kKem, 800U, 1632U, 768U, 32U},
{"ML-KEM-768", PqcAlgorithmKind::kKem, 1184U, 2400U, 1088U, 32U},
{"ML-KEM-1024", PqcAlgorithmKind::kKem, 1568U, 3168U, 1568U, 32U},
}};

/// @brief Look up a standardized PQC algorithm by its textual identifier.
[[nodiscard]] inline constexpr std::optional<PqcAlgorithmInfo> LookupPqcAlgorithm(std::string_view algorithm) noexcept
{
for (const auto& entry : kPqcAlgorithms)
{
if (entry.name == algorithm)
{
return entry;
}
}
return std::nullopt;
}

/// @brief Return whether the identifier names a PQC signature algorithm.
[[nodiscard]] inline constexpr bool IsPqcSignatureAlgorithm(std::string_view algorithm) noexcept
{
const auto info = LookupPqcAlgorithm(algorithm);
return info.has_value() && info->kind == PqcAlgorithmKind::kSignature;
}

/// @brief Return whether the identifier names a PQC KEM algorithm.
[[nodiscard]] inline constexpr bool IsPqcKemAlgorithm(std::string_view algorithm) noexcept
{
const auto info = LookupPqcAlgorithm(algorithm);
return info.has_value() && info->kind == PqcAlgorithmKind::kKem;
}

inline constexpr std::array<KeyAlgorithmInfo, 11UL> kKeyAlgorithms = {{
{"HMAC-SHA256", 32U},
{"HMAC-SHA384", 48U},
{"HMAC-SHA512", 64U},
Expand All @@ -106,7 +173,7 @@ inline constexpr KeyAlgorithmInfo kKeyAlgorithms[] = {
{"AES-256-GCM", 32U},
{"AES-128-CMAC", 16U},
{"AES-256-CMAC", 32U},
};
}};

/// @brief Look up default key size by algorithm name.
/// @return key size in bytes, or std::nullopt if unknown.
Expand Down
Loading
Loading