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

Add chacha12 and chacha20 #257

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

Conversation

godwasdog
Copy link

code form sectun

@godwasdog
Copy link
Author

#251

@wangyu-
Copy link
Owner

wangyu- commented Apr 7, 2019

Hi, thank you for your pull request. Sorry for the late response, cuz its a busy semester now.

I took a quick glance of the code, it looks good. I will merge& test it later, when I have more time..

@wangyu-
Copy link
Owner

wangyu- commented Apr 7, 2019

There might be a problem in the use of fixed (zero) nonce.

Note that I also use zero IV for aes-cfb and aes-cbc, but a property of cbc/cfb is used, so the real IV is in the first data block (and it’s not fixed)...let’s call it a trick

Chacha12/20 works in counter mode(instead of cbc/cfb) and there is no such trick... So there might be a problem. I will confirm this later.

@godwasdog
Copy link
Author

对,这个问题我也注意到了。本来想从 data block前面取uint8_t nonce[12]的。不过没通读源码,不敢乱改。考虑到前面有
`
//static send_bare[buf_len];
  iv_t iv=get_true_random_number_64();
  padding_t padding=get_true_random_number_64();

`
我这种不跨境、小流量的情况下,问题不大。
最后只能把问题留给您了,抱歉。

PS:AR9330(MIPS 24Kc)下比您编译的AES稍微快少少,希望您能测试下其他平台性能

get_current_time_us() never goes back now
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