Skip to content

Store seed in relinkey new#2

Open
drorr-cr wants to merge 12 commits intomainfrom
store-seed-in-relinkey-new
Open

Store seed in relinkey new#2
drorr-cr wants to merge 12 commits intomainfrom
store-seed-in-relinkey-new

Conversation

@drorr-cr
Copy link

No description provided.

@drorr-cr drorr-cr requested a review from NoamK-CR December 25, 2025 16:29
const NativeVector::Integer& modulus){
this->SetModulus(modulus);

if (size != 65536)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is OK for us, but not to push on any main branch...

const NativeVector::Integer& modulus){
this->SetModulus(modulus);

if (size != 65536)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constexpr

Suggested change
if (size != 65536)
if (size != CR_VECTOR_SIZE)

NativeVector v(size, this->m_modulus);
std::uniform_int_distribution<uint32_t> dist(DUG_CHUNK_MIN, DUG_CHUNK_MAX);

for (uint16_t seg_i = 0; seg_i < 2048; ++seg_i) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr

std::unique_ptr<PRNG> shake128engine = std::make_unique<Shake128Engine>(m_seed, m_salt, modulus.ConvertToInt(), seg_i);

size_t valid_words_idx = 0;
uint32_t n_q = (static_cast<uint32_t>((1ULL << 32) / modulus.ConvertToInt())) * modulus.ConvertToInt();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does everything need to be converted to native int?

initKey[1] = static_cast<uint32_t>(std::hash<std::thread::id>{}(std::this_thread::get_id()));

// Heap address entropy
void* mem = malloc(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you copy this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants