Lines Matching defs:secret
55 unsigned char *secret; /* allocated shared secret buffer */
115 * secret is pointed to by *secret. The caller must free it.
127 local_peer->secret = NULL;
157 /* Determine the secret length. */
164 * We are using X25519, so the secret generated will always be 32 bytes.
174 local_peer->secret = OPENSSL_malloc(local_peer->secret_len);
175 if (local_peer->secret == NULL) {
176 fprintf(stderr, "Could not allocate memory for secret\n");
180 /* Derive the shared secret. */
181 if (EVP_PKEY_derive(ctx, local_peer->secret,
187 printf("Shared secret (%s):\n", local_peer->name);
188 BIO_dump_indent_fp(stdout, local_peer->secret, local_peer->secret_len, 2);
196 OPENSSL_clear_free(local_peer->secret, local_peer->secret_len);
197 local_peer->secret = NULL;
224 * After this succeeds, each peer has the same secret in its
241 if (CRYPTO_memcmp(peer1.secret, peer2.secret, peer1.secret_len) != 0) {
246 /* If we are doing the KAT, the secret should equal our reference result. */
247 if (use_kat && CRYPTO_memcmp(peer1.secret, expected_result,
256 OPENSSL_clear_free(peer1.secret, peer1.secret_len);
257 OPENSSL_clear_free(peer2.secret, peer2.secret_len);