Skip to content

fully functioning wolfcrypt shim for Wireguard#1

Open
douzzer wants to merge 33 commits into
masterfrom
wolfcryptified
Open

fully functioning wolfcrypt shim for Wireguard#1
douzzer wants to merge 33 commits into
masterfrom
wolfcryptified

Conversation

@douzzer

@douzzer douzzer commented Oct 26, 2020

Copy link
Copy Markdown
Owner

No description provided.

@dgarske dgarske left a comment

Copy link
Copy Markdown

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.

Comment thread src/wolfcrypto_shim.c
if ((ret = wc_Poly1305_EncodeSizes(&aead->poly, ad_len, src_len)) < 0)
goto out;

if (sl <= -POLY1305_DIGEST_SIZE) {

Copy link
Copy Markdown

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?

Comment thread src/wolfcrypto_shim.h Outdated
}

#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
Copy Markdown

Choose a reason for hiding this comment

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

Read-ability... 80 chars?

Comment thread src/wolfcrypto_shim.h Outdated
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
Copy Markdown

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 18 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.
…vmalloc_node prototype on earlier kernels (e.g. 5.14).
@douzzer douzzer force-pushed the wolfcryptified branch 3 times, most recently from ffebc79 to 34baab6 Compare April 4, 2025 00:48
…r if wc_ChaCha20Poly1305_Final() returns nonzero. fixes new -Wunused-result.
…e[_sync] on kernel >= 6.15, per linux 326534e837 and 8fa7292fee.
…st_lookup_flow(), not ipv6_stub->ipv6_dst_lookup_flow.
…from linux-next (future kernel 7.2) "udp_tunnel: Pass struct sock to udp_tunnel_sock_release()." and "udp_tunnel: Pass struct sock to setup_udp_tunnel_sock()." (both by Kuniyuki Iwashima <kuniyu@google.com>).
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