Lines Matching defs:CURVE25519_SIZE
41 extern int crypto_scalarmult_curve25519(u_char a[CURVE25519_SIZE],
42 const u_char b[CURVE25519_SIZE], const u_char c[CURVE25519_SIZE])
43 __attribute__((__bounded__(__minbytes__, 1, CURVE25519_SIZE)))
44 __attribute__((__bounded__(__minbytes__, 2, CURVE25519_SIZE)))
45 __attribute__((__bounded__(__minbytes__, 3, CURVE25519_SIZE)));
48 kexc25519_keygen(u_char key[CURVE25519_SIZE], u_char pub[CURVE25519_SIZE])
50 static const u_char basepoint[CURVE25519_SIZE] = {9};
52 arc4random_buf(key, CURVE25519_SIZE);
57 kexc25519_shared_key_ext(const u_char key[CURVE25519_SIZE],
58 const u_char pub[CURVE25519_SIZE], struct sshbuf *out, int raw)
60 u_char shared_key[CURVE25519_SIZE];
61 u_char zero[CURVE25519_SIZE];
67 explicit_bzero(zero, CURVE25519_SIZE);
68 if (timingsafe_bcmp(zero, shared_key, CURVE25519_SIZE) == 0)
72 dump_digest("shared secret 25519", shared_key, CURVE25519_SIZE);
75 r = sshbuf_put(out, shared_key, CURVE25519_SIZE);
77 r = sshbuf_put_bignum2_bytes(out, shared_key, CURVE25519_SIZE);
78 explicit_bzero(shared_key, CURVE25519_SIZE);
83 kexc25519_shared_key(const u_char key[CURVE25519_SIZE],
84 const u_char pub[CURVE25519_SIZE], struct sshbuf *out)
98 if ((r = sshbuf_reserve(buf, CURVE25519_SIZE, &cp)) != 0)
102 dump_digest("client public key c25519:", cp, CURVE25519_SIZE);
119 u_char server_key[CURVE25519_SIZE];
125 if (sshbuf_len(client_blob) != CURVE25519_SIZE) {
131 dump_digest("client public key 25519:", client_pub, CURVE25519_SIZE);
138 if ((r = sshbuf_reserve(server_blob, CURVE25519_SIZE, &server_pub)) != 0)
149 dump_digest("server public key 25519:", server_pub, CURVE25519_SIZE);
173 if (sshbuf_len(server_blob) != CURVE25519_SIZE) {
179 dump_digest("server public key c25519:", server_pub, CURVE25519_SIZE);