halo2-code-camp/exercises-ideas #28
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
https://mp.weixin.qq.com/s/s32FxozSDH_BOWHsEO3olQ
@kurtpan666 : 20年复旦本科生密码学课的5个lab都是我设计的。我设计lab的思路就是: 1. ctf 形式,学生可以verifiably的知道自己做对了,比如实现了DES解密预定的文本,执行共模攻击破解一段RSA加密文本等 。2. 把scaffold code 给到位,实验说明文档写清楚。最后学生普遍反馈不错。
@qizhou 这个很好。我跟 @po 商量了一下,我们计划把zkVM(尤其我们在合作的zkWasm)的一些子电路分拆出来,给大家做exercise
也是 @frank Jz Liu 这里面 https://palm-isthmus-1e4.notion.site/Halo2-As-A-Compiler-Series-21f07032ca35450fad310de9aa1feee6 第4部分的细化
我现在想到的就有:
1,如何做uint64的整数电路
2,在uint64的整数检查的基础上,怎么做uint64乘法(可以overflow)电路
3,在uint64的整数检查的基础上,怎么做uint64除法电路
4,最简单的内存read/write电路设计
(其实很多uint64的运算指令都是很好的电路设计问题)
@readygo67 : @Qi Zhou 我不知道我的理解是否正确,如果是我的话,会把uint 64转换成fp,然后再进行运算,最后的运算结果,如果不考虑溢出的话,就取低64位就好了
@qizhou 需要设计成为约束系统,比如如何取低64位(e.g., a + k * 2^64 where a in [0, 2^64) )
除法稍微麻烦一点
我的wild idea:如果这期Halo2大家觉得不错,我觉得下一期可以扩展exercise,做一期zkVM😄
@readygo67 : 除法用Fp的invert 是不是就可以了,对于a/b如果能整除,比如6/2应该是没问题,对于不能整除的情况比如6/4可能不太合适,如果a<b,商直接就是0了。 —— 需要支持不整除的情况的
@frank : 问题不是在Fp上计算啊,还是要用电路实现乘法器和除法器
@readygo67 : 把计算结果写在cell当中,然后去验证,就相当于使用电路了 (halo2中电路特性感觉没有像circom强)
@frank: (写在cell..) 这只是你填witness的过程。需要用constraint_system.create_gate 来自定义约束
The text was updated successfully, but these errors were encountered: