Skip to content

Commit

Permalink
fix typo of kyber1024 sk from 3186 to 3168
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkjall committed May 22, 2023
1 parent daee256 commit 191a4ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/ffi/ffi_pkey_algs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,12 +1040,12 @@ int botan_pubkey_kyber768_get_pubkey(botan_pubkey_t key,
}

int botan_privkey_load_kyber1024(botan_privkey_t* key,
const uint8_t privkey[3186])
const uint8_t privkey[3168])
{
#if defined(BOTAN_HAS_KYBER)
*key = nullptr;
return ffi_guard_thunk(__func__, [=]() -> int {
const Botan::secure_vector<uint8_t> privkey_vec(privkey, privkey + 3186);
const Botan::secure_vector<uint8_t> privkey_vec(privkey, privkey + 3168);
auto kyber1024 = std::make_unique<Botan::Kyber_PrivateKey>(privkey_vec, Botan::KyberMode::Kyber1024);
*key = new botan_privkey_struct(std::move(kyber1024));
return BOTAN_FFI_SUCCESS;
Expand Down Expand Up @@ -1074,14 +1074,14 @@ int botan_pubkey_load_kyber1024(botan_pubkey_t* key,
}

int botan_privkey_kyber1024_get_privkey(botan_privkey_t key,
uint8_t output[3186])
uint8_t output[3168])
{
#if defined(BOTAN_HAS_KYBER)
return BOTAN_FFI_VISIT(key, [=](const auto& k) {
if(auto kyber1024 = dynamic_cast<const Botan::Kyber_PrivateKey*>(&k))
{
const auto kyber1024_key = kyber1024->raw_private_key_bits();
if(kyber1024_key.size() != 3186)
if(kyber1024_key.size() != 3168)
return BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE;
Botan::copy_mem(output, kyber1024_key.data(), kyber1024_key.size());
return BOTAN_FFI_SUCCESS;
Expand Down

0 comments on commit 191a4ad

Please sign in to comment.