Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ib/hash map gadget #18

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Ib/hash map gadget #18

wants to merge 8 commits into from

Conversation

Barichek
Copy link
Contributor

No description provided.

Copy link
Member

@gluk64 gluk64 left a comment

Choose a reason for hiding this comment

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

в детали нужно чтоб @shamatar и @alexander-movchan посмотрели.

@@ -644,6 +644,22 @@ impl Boolean {
}
}

/// Perform OR over two boolean operands
pub fn or<'a, E, CS>(
Copy link
Member

Choose a reason for hiding this comment

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

его точно не было? спрашивал у @shamatar ?

cs.namespace(|| "zero value"),
|| Ok(E::Fr::zero())
)?;
cs.enforce(
Copy link
Member

Choose a reason for hiding this comment

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

здесь не принципиально, но вообще-то есть тип expression чтобы такого не делать

) -> Result<Vec<AllocatedNum<E>>, SynthesisError>
where CS: ConstraintSystem<E>
{
if (self.is_finalized) {
Copy link
Member

Choose a reason for hiding this comment

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

а вот это можно интересно решить на уровне компилятора раста: посмотри как работает стандартная функция drop().

Copy link
Member

Choose a reason for hiding this comment

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

похожим образом ты можешь сделать так, что гэджет можно будет финализировать ровно один раз и никто не ошибется. но может быть это черезчур заморочка.

Copy link
Member

Choose a reason for hiding this comment

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

Это делается маркер-трейтом в темплейте

}
}

/// AS-Waksman permutation network
Copy link
Member

Choose a reason for hiding this comment

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

Если это ваксман, то зачем было это писать для начала?

@shamatar
Copy link
Member

Ну и главный вопрос - зачем все это? На каких размерах это эффективнее чем дерево с хорошим хэшом?

pub fn new<CS>(
mut cs: CS,
fields_in_value: usize,
default_value: Option<Vec<AllocatedNum<E>>>,
Copy link
Member

Choose a reason for hiding this comment

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

Option тип только для витнесса

mut cs: CS,
fields_in_value: usize,
default_value: Option<Vec<AllocatedNum<E>>>,
key_bitlength: Option<usize>
Copy link
Member

Choose a reason for hiding this comment

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

Тоже не нужен Option, гаджет всегда должен иметь заранее известный размер

&mut self,
mut cs: CS,
key: &AllocatedNum<E>,
new_value: Option<&Vec<AllocatedNum<E>>>
Copy link
Member

Choose a reason for hiding this comment

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

Аналогично, тут не может быть Option

@shamatar
Copy link
Member

Нужно описание гаджета, что делает, какая логика энфорсмента

@gluk64
Copy link
Member

gluk64 commented Feb 12, 2020

Ну и главный вопрос - зачем все это? На каких размерах это эффективнее чем дерево с хорошим хэшом?

Да, формулы сравнения констрейнтов важно дописать в комментариях.

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.

None yet

3 participants