Tor  0.4.6.0-alpha-dev
Data Structures | Macros | Functions
hs_ntor.h File Reference

Header for hs_ntor.c. More...

#include "core/or/or.h"

Go to the source code of this file.

Data Structures

struct  hs_ntor_intro_cell_keys_t
 
struct  hs_ntor_rend_cell_keys_t
 
struct  hs_subcredential_t
 

Macros

#define HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN    (DIGEST256_LEN*2 + CIPHER256_KEY_LEN*2)
 
#define SUBCRED_LEN   DIGEST256_LEN
 

Functions

int hs_ntor_client_get_introduce1_keys (const struct ed25519_public_key_t *intro_auth_pubkey, const struct curve25519_public_key_t *intro_enc_pubkey, const struct curve25519_keypair_t *client_ephemeral_enc_keypair, const hs_subcredential_t *subcredential, hs_ntor_intro_cell_keys_t *hs_ntor_intro_cell_keys_out)
 
int hs_ntor_client_get_rendezvous1_keys (const struct ed25519_public_key_t *intro_auth_pubkey, const struct curve25519_keypair_t *client_ephemeral_enc_keypair, const struct curve25519_public_key_t *intro_enc_pubkey, const struct curve25519_public_key_t *service_ephemeral_rend_pubkey, hs_ntor_rend_cell_keys_t *hs_ntor_rend_cell_keys_out)
 
int hs_ntor_service_get_introduce1_keys_multi (const struct ed25519_public_key_t *intro_auth_pubkey, const struct curve25519_keypair_t *intro_enc_keypair, const struct curve25519_public_key_t *client_ephemeral_enc_pubkey, size_t n_subcredentials, const hs_subcredential_t *subcredentials, hs_ntor_intro_cell_keys_t *hs_ntor_intro_cell_keys_out)
 
int hs_ntor_service_get_introduce1_keys (const struct ed25519_public_key_t *intro_auth_pubkey, const struct curve25519_keypair_t *intro_enc_keypair, const struct curve25519_public_key_t *client_ephemeral_enc_pubkey, const hs_subcredential_t *subcredential, hs_ntor_intro_cell_keys_t *hs_ntor_intro_cell_keys_out)
 
int hs_ntor_service_get_rendezvous1_keys (const struct ed25519_public_key_t *intro_auth_pubkey, const struct curve25519_keypair_t *intro_enc_keypair, const struct curve25519_keypair_t *service_ephemeral_rend_keypair, const struct curve25519_public_key_t *client_ephemeral_enc_pubkey, hs_ntor_rend_cell_keys_t *hs_ntor_rend_cell_keys_out)
 
int hs_ntor_circuit_key_expansion (const uint8_t *ntor_key_seed, size_t seed_len, uint8_t *keys_out, size_t keys_out_len)
 
int hs_ntor_client_rendezvous2_mac_is_good (const hs_ntor_rend_cell_keys_t *hs_ntor_rend_cell_keys, const uint8_t *rcvd_mac)
 

Detailed Description

Header for hs_ntor.c.

Definition in file hs_ntor.h.

Function Documentation

◆ hs_ntor_circuit_key_expansion()

int hs_ntor_circuit_key_expansion ( const uint8_t *  ntor_key_seed,
size_t  seed_len,
uint8_t *  keys_out,
size_t  keys_out_len 
)

Given the rendezvous key seed in ntor_key_seed (of size DIGEST256_LEN), do the circuit key expansion as specified by section '4.2.1. Key expansion' and place the keys in keys_out (which must be of size HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN).

Return 0 if things went well, else return -1.

Definition at line 615 of file hs_ntor.c.

◆ hs_ntor_client_rendezvous2_mac_is_good()

int hs_ntor_client_rendezvous2_mac_is_good ( const hs_ntor_rend_cell_keys_t hs_ntor_rend_cell_keys,
const uint8_t *  rcvd_mac 
)

Given a received RENDEZVOUS2 MAC in mac (of length DIGEST256_LEN), and the RENDEZVOUS1 key material in hs_ntor_rend_cell_keys, return 1 if the MAC is good, otherwise return 0.

Definition at line 594 of file hs_ntor.c.

◆ hs_ntor_service_get_introduce1_keys_multi()

int hs_ntor_service_get_introduce1_keys_multi ( const struct ed25519_public_key_t intro_auth_pubkey,
const struct curve25519_keypair_t intro_enc_keypair,
const struct curve25519_public_key_t client_ephemeral_enc_pubkey,
size_t  n_subcredentials,
const hs_subcredential_t subcredentials,
hs_ntor_intro_cell_keys_t hs_ntor_intro_cell_keys_out 
)

As hs_ntor_service_get_introduce1_keys(), but take multiple subcredentials as input, and yield multiple sets of keys as output.

Definition at line 470 of file hs_ntor.c.