Lines Matching refs:CURVE25519_SIZE
43 extern int crypto_scalarmult_curve25519(u_char a[CURVE25519_SIZE],
44 const u_char b[CURVE25519_SIZE], const u_char c[CURVE25519_SIZE])
45 __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
46 __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)))
47 __attribute__((__bounded__(__minbytes__, 3, CURVE25519_SIZE)));
50 kexc25519_keygen(u_char key[CURVE25519_SIZE], u_char pub[CURVE25519_SIZE]) in kexc25519_keygen() argument
52 static const u_char basepoint[CURVE25519_SIZE] = {9}; in kexc25519_keygen()
54 arc4random_buf(key, CURVE25519_SIZE); in kexc25519_keygen()
59 kexc25519_shared_key_ext(const u_char key[CURVE25519_SIZE], in kexc25519_shared_key_ext() argument
60 const u_char pub[CURVE25519_SIZE], struct sshbuf *out, int raw) in kexc25519_shared_key_ext() argument
62 u_char shared_key[CURVE25519_SIZE]; in kexc25519_shared_key_ext()
63 u_char zero[CURVE25519_SIZE]; in kexc25519_shared_key_ext()
69 explicit_bzero(zero, CURVE25519_SIZE); in kexc25519_shared_key_ext()
70 if (timingsafe_bcmp(zero, shared_key, CURVE25519_SIZE) == 0) in kexc25519_shared_key_ext()
74 dump_digest("shared secret", shared_key, CURVE25519_SIZE); in kexc25519_shared_key_ext()
77 r = sshbuf_put(out, shared_key, CURVE25519_SIZE); in kexc25519_shared_key_ext()
79 r = sshbuf_put_bignum2_bytes(out, shared_key, CURVE25519_SIZE); in kexc25519_shared_key_ext()
80 explicit_bzero(shared_key, CURVE25519_SIZE); in kexc25519_shared_key_ext()
85 kexc25519_shared_key(const u_char key[CURVE25519_SIZE], in kexc25519_shared_key() argument
86 const u_char pub[CURVE25519_SIZE], struct sshbuf *out) in kexc25519_shared_key() argument
100 if ((r = sshbuf_reserve(buf, CURVE25519_SIZE, &cp)) != 0) in kex_c25519_keypair()
104 dump_digest("client public key c25519:", cp, CURVE25519_SIZE); in kex_c25519_keypair()
121 u_char server_key[CURVE25519_SIZE]; in kex_c25519_enc()
127 if (sshbuf_len(client_blob) != CURVE25519_SIZE) { in kex_c25519_enc()
133 dump_digest("client public key 25519:", client_pub, CURVE25519_SIZE); in kex_c25519_enc()
140 if ((r = sshbuf_reserve(server_blob, CURVE25519_SIZE, &server_pub)) != 0) in kex_c25519_enc()
151 dump_digest("server public key 25519:", server_pub, CURVE25519_SIZE); in kex_c25519_enc()
175 if (sshbuf_len(server_blob) != CURVE25519_SIZE) { in kex_c25519_dec()
181 dump_digest("server public key c25519:", server_pub, CURVE25519_SIZE); in kex_c25519_dec()