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

fully functioning wolfcrypt shim for Wireguard #1

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

Conversation

douzzer
Copy link
Owner

@douzzer douzzer commented Oct 26, 2020

No description provided.

Copy link

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Mostly formatting issues otherwise looks good. Please double check the negative poly at 159.

if ((ret = wc_Poly1305_EncodeSizes(&aead->poly, ad_len, src_len)) < 0)
goto out;

if (sl <= -POLY1305_DIGEST_SIZE) {
Copy link

Choose a reason for hiding this comment

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

Is the negative on -POLY1305_DIGEST_SIZE intentional? If so can you add comment explaining?

}

#define curve25519(...) curve25519_wolfshim(__VA_ARGS__)
static inline bool curve25519(uint8_t mypublic[static CURVE25519_KEY_SIZE], const uint8_t secret[static CURVE25519_KEY_SIZE], const uint8_t basepoint[static CURVE25519_KEY_SIZE]) {
Copy link

Choose a reason for hiding this comment

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

Read-ability... 80 chars?

const u8 *ad, const size_t ad_len,
const u64 nonce,
const u8 key[CHACHA20POLY1305_KEY_SIZE]) {
word64 inIV[2] = { 0, cpu_to_le64(nonce) };
Copy link

Choose a reason for hiding this comment

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

Indent

douzzer and others added 15 commits November 2, 2020 12:47
…): for kernel >= 6.2, use get_random_u32_below() rather than prandom_u32_max().
…c.c at >=d9f7629296 can be compiled in the wireguard module.
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