text stringlengths 1 9.98k | __index_level_0__ int64 0 4.17k |
|---|---|
11n development) */
#define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14))
#define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
/* HT Extended Capabilities field within HT Capabilities element */
#define EXT_HT_CAP_INFO_PCO ((u16) BIT(0))
#define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK ((u16) (BIT(1) | BIT(2)))
... | 2,923 |
.B31 - Reserved */
/* ASEL Capability field within HT Capabilities element */
#define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0))
#define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
#define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
#define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
#de... | 2,923 |
.B9 */
#define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT ((u16) BIT(2)) /* B10 */
/* BIT(3), i.e., B11 in HT Operation Information field - Reserved */
#define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT ((u16) BIT(4)) /* B12 */
/* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */
/* Last two octets of HT Operation Information (... | 2,923 |
0 */
u8 qos_info; /* AP/STA specific QoS info */
} STRUCT_PACKED;
#define WMM_AC_AIFSN_MASK 0x0f
#define WMM_AC_AIFNS_SHIFT 0
#define WMM_AC_ACM 0x10
#define WMM_AC_ACI_MASK 0x60
#define WMM_AC_ACI_SHIFT 5
#define WMM_AC_ECWMIN_MASK 0x0f
#define WMM_AC_ECWMIN_SHIFT 0
#define WMM_AC_ECWMAX_MASK 0xf0
#define WMM_AC_E... | 2,923 |
0_r19, 4.2: MBO Attributes */
/* Table 4-5: MBO Attributes */
/* OCE v0.0.10, Table 4-3: OCE Attributes */
enum mbo_attr_id {
MBO_ATTR_ID_AP_CAPA_IND = 1,
MBO_ATTR_ID_NON_PREF_CHAN_REPORT = 2,
MBO_ATTR_ID_CELL_DATA_CAPA = 3,
MBO_ATTR_ID_ASSOC_DISALLOW = 4,
MBO_ATTR_ID_CELL_DATA_PREF = 5,
MBO_ATTR_ID_TRANSITION_RE... | 2,923 |
0_r19, 4.2.3: Cellular Data Capabilities Attribute */
/* Table 4-13: Cellular Data Connectivity Field */
enum mbo_cellular_capa {
MBO_CELL_CAPA_AVAILABLE = 1,
MBO_CELL_CAPA_NOT_AVAILABLE = 2,
MBO_CELL_CAPA_NOT_SUPPORTED = 3,
};
/* MBO v0.0_r19, 4.2.7: Transition Rejection Reason Code Attribute */
/* Table 4-21: Tra... | 2,923 |
11v - BSS Transition Management Request - Request Mode */
#define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
#define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
#define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
#define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
#define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
/* IEEE Std 8... | 2,923 |
11-2012, 8.5.7.4 - Link Measurement Request frame format */
struct rrm_link_measurement_request {
u8 dialog_token;
s8 tx_power;
s8 max_tp;
u8 variable[0];
} STRUCT_PACKED;
/* IEEE Std 802.11-2012, 8.5.7.5 - Link Measurement Report frame format */
struct rrm_link_measurement_report {
u8 dialog_token;
struct tpc_r... | 2,923 |
11-2016, 9.4.2.21.7 - Beacon request */
struct rrm_measurement_beacon_request {
u8 oper_class; /* Operating Class */
u8 channel; /* Channel Number */
le16 rand_interval; /* Randomization Interval (in TUs) */
le16 duration; /* Measurement Duration (in TUs) */
u8 mode; /* Measurement Mode */
u8 bssid[ETH_ALEN]; /* ... | 2,923 |
11-2016, 9.4.2.22 - Measurement Report element */
struct rrm_measurement_report_element {
u8 eid; /* Element ID */
u8 len; /* Length */
u8 token; /* Measurement Token */
u8 mode; /* Measurement Report Mode */
u8 type; /* Measurement Type */
u8 variable[0]; /* Measurement Report */
} STRUCT_PACKED;
/* IEEE Std 80... | 2,923 |
11-2016, Table 9-112 - Beacon report Subelement IDs */
/* IEEE P802.11-REVmd/D2.0, Table 9-130 - Optional subelement IDs for
#define WLAN_BEACON_REPORT_SUBELEM_FRAME_BODY 1
#define WLAN_BEACON_REPORT_SUBELEM_FRAME_BODY_FRAGMENT_ID 2
#define WLAN_BEACON_REPORT_SUBELEM_LAST_INDICATION 164
/* IEEE P802.11-REVmd/D2.0, Tab... | 2,923 |
/*
*/
#ifndef BSS_H
#define BSS_H
struct wpa_scan_res;
struct wpa_supplicant;
/**
*/
struct wpa_bss {
/** List entry for struct wpa_supplicant::bss */
struct dl_list list;
/** List entry for struct wpa_supplicant::bss_id */
struct dl_list list_id;
/** Unique identifier for this BSS entry */
unsigned int id;
... | 2,924 |
e., Beacon or Probe Response RX) */
struct os_reltime last_update;
/** Length of the following IE field in octets (from Probe Response) */
size_t ie_len;
/** Length of the following Beacon IE field in octets */
size_t beacon_ie_len;
/* followed by ie_len octets of IEs */
/* followed by beacon_ie_len octets of IE... | 2,924 |
/*
*/
#ifndef WNM_STA_H
#define WNM_STA_H
struct measurement_pilot {
u8 measurement_pilot;
u8 subelem_len;
u8 subelems[255];
};
struct multiple_bssid {
u8 max_bssid_indicator;
u8 subelem_len;
u8 subelems[255];
};
struct neighbor_report {
u8 bssid[ETH_ALEN];
u32 bssid_info;
u8 regulatory_class;
u8 channel... | 2,925 |
/*
*/
#ifndef DRAGONFLY_H
#define DRAGONFLY_H
#define DRAGONFLY_MAX_ECC_PRIME_LEN 66
struct crypto_bignum;
struct crypto_ec;
int dragonfly_suitable_group(int group, int ecc_only);
unsigned int dragonfly_min_pwe_loop_iter(int group);
int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime,
struct cryp... | 2,926 |
/*
*/
#ifndef SCAN_H
#define SCAN_H
/*
*/
#define DEFAULT_NOISE_FLOOR_2GHZ (-89)
struct wpa_driver_scan_params;
void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec);
int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
struct wpa_driver_scan_params *params);
const u8 * wpa_sca... | 2,927 |
c */
struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf);
struct wpabuf * ndef_build_wifi(const struct wpabuf *buf);
struct wpabuf * ndef_parse_p2p(const struct wpabuf *buf);
struct wpabuf * ndef_build_p2p(const struct wpabuf *buf);
#ifdef CONFIG_WPS_STRICT
int wps_validate_beacon(const struct wpabuf *wps_ie);
i... | 2,928 |
/*
*/
#ifndef WPS_DEFS_H
#define WPS_DEFS_H
#ifdef CONFIG_WPS_TESTING
extern int wps_version_number;
extern int wps_testing_stub_cred;
extern int wps_corrupt_pkhash;
extern int wps_force_auth_types_in_use;
extern u16 wps_force_auth_types;
extern int wps_force_encr_types_in_use;
extern u16 wps_force_encr_types;
#def... | 2,929 |
/*
*/
#ifndef WPS_ATTR_PARSE_H
#define WPS_ATTR_PARSE_H
#include "wps.h"
struct wps_parse_attr {
/* fixed length fields */
const u8 *version; /* 1 octet */
const u8 *version2; /* 1 octet */
const u8 *msg_type; /* 1 octet */
const u8 *enrollee_nonce; /* WPS_NONCE_LEN (16) octets */
const u8 *registrar_nonce; /... | 2,930 |
.54 octets */
u16 manufacturer_len;
u16 model_name_len;
u16 model_number_len;
u16 serial_number_len;
u16 dev_name_len;
u16 public_key_len;
u16 encr_settings_len;
u16 ssid_len;
u16 network_key_len;
u16 authorized_macs_len;
u16 sec_dev_type_list_len;
u16 oob_dev_password_len;
/* attributes that can occur mu... | 2,930 |
/*
*/
#ifndef WPS_I_H
#define WPS_I_H
#include "wps.h"
#include "wps_attr_parse.h"
#ifdef CONFIG_WPS_NFC
struct wps_nfc_pw_token;
#endif
/**
*/
struct wps_data {
/**
*/
struct wps_context *wps;
/**
*/
int registrar;
/**
*/
int er;
enum {
/* Enrollee states */
SEND_M1, RECV_M2, SEND_M3, RECV_M4,... | 2,931 |
c */
void wps_kdf(const u8 *key, const u8 *label_prefix, size_t label_prefix_len,
const char *label, u8 *res, size_t res_len);
int wps_derive_keys(struct wps_data *wps);
int wps_derive_psk(struct wps_data *wps, const u8 *dev_passwd,
size_t dev_passwd_len);
struct wpabuf * wps_decrypt_encr_settings(struct wps... | 2,931 |
c */
int wps_build_public_key(struct wps_data *wps, struct wpabuf *msg);
int wps_build_req_type(struct wpabuf *msg, enum wps_request_type type);
int wps_build_resp_type(struct wpabuf *msg, enum wps_response_type type);
int wps_build_config_methods(struct wpabuf *msg, u16 methods);
int wps_build_uuid_e(struct wpabuf *ms... | 2,931 |
c */
int wps_process_authenticator(struct wps_data *wps, const u8 *authenticator,
const struct wpabuf *msg);
int wps_process_key_wrap_auth(struct wps_data *wps, struct wpabuf *msg,
const u8 *key_wrap_auth);
int wps_process_cred(struct wps_parse_attr *attr,
struct wps_credential *cred);
int wps_... | 2,931 |
/*
*/
#ifndef WPS_DEV_ATTR_H
#define WPS_DEV_ATTR_H
struct wps_parse_attr;
int wps_build_manufacturer(struct wps_device_data *dev, struct wpabuf *msg);
int wps_build_model_name(struct wps_device_data *dev, struct wpabuf *msg);
int wps_build_model_number(struct wps_device_data *dev, struct wpabuf *msg);
int wps_buil... | 2,932 |
/*
*/
#ifndef PKCS5_H
#define PKCS5_H
u8 * pkcs5_decrypt(const u8 *enc_alg, size_t enc_alg_len,
const u8 *enc_data, size_t enc_data_len,
const char *passwd, size_t *data_len);
#endif /* PKCS5_H */
| 2,933 |
/*
*/
#ifndef PKCS1_H
#define PKCS1_H
struct crypto_public_key;
struct asn1_oid;
int pkcs1_encrypt(int block_type, struct crypto_rsa_key *key,
int use_private, const u8 *in, size_t inlen,
u8 *out, size_t *outlen);
int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key,
const u8 *in, size_t inlen... | 2,934 |
/*
*/
#ifndef ASN1_H
#define ASN1_H
#define ASN1_TAG_EOC 0x00 /* not used with DER */
#define ASN1_TAG_BOOLEAN 0x01
#define ASN1_TAG_INTEGER 0x02
#define ASN1_TAG_BITSTRING 0x03
#define ASN1_TAG_OCTETSTRING 0x04
#define ASN1_TAG_NULL 0x05
#define ASN1_TAG_OID 0x06
#define ASN1_TAG_OBJECT_DESCRIPTOR 0x07 /* not ye... | 2,935 |
= ASN1_CLASS_UNIVERSAL || hdr->constructed)
return false;
return hdr->tag == ASN1_TAG_UTF8STRING ||
hdr->tag == ASN1_TAG_NUMERICSTRING ||
hdr->tag == ASN1_TAG_PRINTABLESTRING ||
hdr->tag == ASN1_TAG_T61STRING ||
hdr->tag == ASN1_TAG_VIDEOTEXSTRING ||
hdr->tag == ASN1_TAG_IA5STRING ||
hdr->tag == ASN1_TAG... | 2,935 |
/*
*/
#ifndef TLSV1_SERVER_H
#define TLSV1_SERVER_H
#include "tlsv1_cred.h"
struct tlsv1_server;
int tlsv1_server_global_init(void);
void tlsv1_server_global_deinit(void);
struct tlsv1_server * tlsv1_server_init(struct tlsv1_credentials *cred);
void tlsv1_server_deinit(struct tlsv1_server *conn);
int tlsv1_server_... | 2,936 |
/*
*/
#ifndef X509V3_H
#define X509V3_H
#include "asn1.h"
struct x509_algorithm_identifier {
struct asn1_oid oid;
};
struct x509_name_attr {
enum x509_name_attr_type {
X509_NAME_ATTR_NOT_USED,
X509_NAME_ATTR_DC,
X509_NAME_ATTR_CN,
X509_NAME_ATTR_C,
X509_NAME_ATTR_L,
X509_NAME_ATTR_ST,
X509_NAME_ATT... | 2,937 |
/*
*/
#ifndef TLSV1_CRED_H
#define TLSV1_CRED_H
struct tlsv1_credentials {
struct x509_certificate *trusted_certs;
struct x509_certificate *cert;
struct crypto_private_key *key;
unsigned int cert_probe:1;
unsigned int ca_cert_verify:1;
unsigned int server_cert_only:1;
u8 srv_cert_hash[32];
/* Diffie-Hellma... | 2,938 |
/*
*/
#ifndef TLSV1_COMMON_H
#define TLSV1_COMMON_H
#include "crypto/crypto.h"
#define TLS_VERSION_1 0x0301 /* TLSv1 */
#define TLS_VERSION_1_1 0x0302 /* TLSv1.1 */
#define TLS_VERSION_1_2 0x0303 /* TLSv1.2 */
#ifdef CONFIG_TLSV12
#define TLS_VERSION TLS_VERSION_1_2
#else /* CONFIG_TLSV12 */
#ifdef CONFIG_TLSV11
#d... | 2,939 |
/*
*/
#ifndef PKCS8_H
#define PKCS8_H
struct crypto_private_key * pkcs8_key_import(const u8 *buf, size_t len);
struct crypto_private_key *
pkcs8_enc_key_import(const u8 *buf, size_t len, const char *passwd);
#endif /* PKCS8_H */
| 2,940 |
/*
*/
#ifndef TLSV1_SERVER_I_H
#define TLSV1_SERVER_I_H
struct tlsv1_server {
enum {
CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE,
SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST,
SERVER_HELLO_DONE, CLIENT_CERTIFICATE, CLIENT_KEY_EXCHANGE,
CERTIFICATE_VERIFY, CHANGE_CIPHER_SPEC, CLIENT_FINISHED,
SERVER_... | 2,941 |
..)
PRINTF_FORMAT(2, 3);
void tlsv1_server_alert(struct tlsv1_server *conn, u8 level, u8 description);
int tlsv1_server_derive_keys(struct tlsv1_server *conn,
const u8 *pre_master_secret,
size_t pre_master_secret_len);
u8 * tlsv1_server_handshake_write(struct tlsv1_server *conn, size_t *out_len);
u8 * ... | 2,941 |
/*
*/
#ifndef TLSV1_RECORD_H
#define TLSV1_RECORD_H
#include "crypto/crypto.h"
#define TLS_MAX_WRITE_MAC_SECRET_LEN 32
#define TLS_MAX_WRITE_KEY_LEN 32
#define TLS_MAX_IV_LEN 16
#define TLS_MAX_KEY_BLOCK_LEN (2 * (TLS_MAX_WRITE_MAC_SECRET_LEN + \
TLS_MAX_WRITE_KEY_LEN + TLS_MAX_IV_LEN))
#define TLS_SEQ_NUM... | 2,942 |
/*
*/
#ifndef TLSV1_CLIENT_I_H
#define TLSV1_CLIENT_I_H
struct tlsv1_client {
enum {
CLIENT_HELLO, SERVER_HELLO, SERVER_CERTIFICATE,
SERVER_KEY_EXCHANGE, SERVER_CERTIFICATE_REQUEST,
SERVER_HELLO_DONE, CLIENT_KEY_EXCHANGE, CHANGE_CIPHER_SPEC,
SERVER_CHANGE_CIPHER_SPEC, SERVER_FINISHED, ACK_FINISHED,
ESTABL... | 2,943 |
/*
*/
#include "os.h"
#include "stdarg.h"
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
#define BN_MP_INVMOD_C
#define BN_S_MP_EXPTMOD_C /* Note: #undef in tommath_superclass.h; this would
#define BN_S_MP_MUL_DIGS_C
#define BN_MP_INVMOD_SLOW_C
#define BN_S_MP_SQR_C
#define BN_S_MP_MUL_HIGH_DIGS_C /* Note: #undef in tom... | 2,944 |
h */
#ifndef MIN
#define MIN(x,y) ((x)(y)?(x):(y))
#endif
#define OPT_CAST(x) (x *)
typedef unsigned long mp_digit;
typedef u64 mp_word;
#define DIGIT_BIT 28
#define MP_28BIT
#define XMALLOC os_malloc
#define XFREE os_free
#define XREALLOC os_realloc
#define MP_MASK ((((mp_digit)1) Bas... | 2,944 |
..);
#endif
#ifdef BN_MP_CLEAR_MULTI_C
static void mp_clear_multi(mp_int *mp, ...);
#endif
static int mp_lshd(mp_int * a, int b);
static void mp_set(mp_int * a, mp_digit b);
static void mp_clamp(mp_int * a);
static void mp_exch(mp_int * a, mp_int * b);
static void mp_rshd(mp_int * a, int b);
static void mp_zero(mp_int ... | 2,944 |
c */
/* reverse an array, used for radix code */
static void
bn_reverse (unsigned char *s, int len)
{
int ix, iy;
unsigned char t;
ix = 0;
iy = len - 1;
while (ix used > b->used) {
min = b->used;
max = a->used;
x = a;
} else {
min = a->used;
max = b->used;
x = b;
}
/* ini... | 2,944 |
595 Algorithm 14.9 */
static int
s_mp_sub (mp_int * a, mp_int * b, mp_int * c)
{
int olduse, res, min, max;
/* find sizes */
min = b->used;
max = a->used;
/* init result */
if (c->alloc used;
c->used = max;
{
register mp_digit u, *tmpa, *tmpb, *tmpc;
register int i;
/* alias for digi... | 2,944 |
= NULL) {
/* first zero the digits */
for (i = 0; i used; i++) {
a->dp[i] = 0;
}
/* free ram */
XFREE(a->dp);
/* reset members to make debugging easier */
a->dp = NULL;
a->alloc = a->used = 0;
a->sign = MP_ZPOS;
}
}
/* high level addition (handles signs) */
static i... | 2,944 |
= sb) {
/* subtract a negative from a positive, OR */
/* subtract a positive from a negative. */
/* In either case, ADD their magnitudes, */
/* and use the sign of the first number. */
c->sign = sa;
res = s_mp_add (a, b, c);
} else {
/* subtract a positive from a positive, OR */
/* sub... | 2,944 |
MP_ZPOS : MP_NEG;
/* use Toom-Cook? */
#ifdef BN_MP_TOOM_MUL_C
if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) {
res = mp_toom_mul(a, b, c);
} else
#endif
#ifdef BN_MP_KARATSUBA_MUL_C
/* use Karatsuba? */
if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) {
res = mp_karatsuba_mul (a, b, c);
} else... | 2,944 |
= MP_OKAY) {
return err;
}
if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) {
mp_clear(&tmpG);
return err;
}
/* now get |X| */
if ((err = mp_init(&tmpX)) != MP_OKAY) {
mp_clear(&tmpG);
return err;
}
if ((err = mp_abs(X, &tmpX)) != MP_OKAY) {
... | 2,944 |
= 0 ? 1 : 0));
}
#ifndef LTM_NO_NEG_EXP
/* hac 14.61, pp608 */
static int
mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c)
{
mp_int x, y, u, v, A, B, C, D;
int res;
/* b cannot be negative */
if (b->sign == MP_NEG || mp_iszero(b) == 1) {
return MP_VAL;
}
/* init temps */
if ((res = mp_init... | 2,944 |
1 u = u/2 */
if ((res = mp_div_2 (&u, &u)) != MP_OKAY) {
goto LBL_ERR;
}
/* 4.2 if A or B is odd then */
if (mp_isodd (&A) == 1 || mp_isodd (&B) == 1) {
/* A = (A+y)/2, B = (B-x)/2 */
if ((res = mp_add (&A, &y, &A)) != MP_OKAY) {
goto LBL_ERR;
}
if ((res = mp_sub (... | 2,944 |
= MP_OKAY) {
goto LBL_ERR;
}
if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {
goto LBL_ERR;
}
}
/* 6. if u >= v then */
if (mp_cmp (&u, &v) != MP_LT) {
/* u = u - v, A = A - C, B = B - D */
if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) {
goto LBL_ERR;
}
if ((res = mp_sub ... | 2,944 |
= MP_OKAY) {
goto LBL_ERR;
}
}
/* too big */
while (mp_cmp_mag(&C, b) != MP_LT) {
if ((res = mp_sub(&C, b, &C)) != MP_OKAY) {
goto LBL_ERR;
}
}
/* C is now the inverse */
mp_exch (&C, c);
res = MP_OKAY;
LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL);
... | 2,944 |
= MP_OKAY) {
return res;
}
x = 0;
while (mp_iszero (&t) == 0) {
#ifndef MP_8BIT
b[x++] = (unsigned char) (t.dp[0] & 255);
#else
b[x++] = (unsigned char) (t.dp[0] | ((t.dp[1] & 0x01) = (int)DIGIT_BIT) {
mp_rshd (c, b / DIGIT_BIT);
}
/* shift any bit count dp + (c->used - 1);
/* carry... | 2,944 |
.. | bb | >
/\ | >
\/ >
*/
for (x = 0; x used - b); x++) {
*bottom++ = *top++;
}
/* zero the top digits */
for (; x used; x++) {
*bottom++ = 0;
}
}
/* remove excess digits */
a->used -= b;
}
/* swap the eleme... | 2,944 |
= b) {
if ((res = mp_copy (a, b)) != MP_OKAY) {
return res;
}
}
/* force the sign of b to positive */
b->sign = MP_ZPOS;
return MP_OKAY;
}
#endif
/* set to a digit */
static void
mp_set (mp_int * a, mp_digit b)
{
mp_zero (a);
a->dp[0] = b & MP_MASK;
a->used = (a->dp[0] != 0) ? 1 : 0;... | 2,944 |
= c) {
if ((res = mp_copy (a, c)) != MP_OKAY) {
return res;
}
}
if (c->alloc used + b/DIGIT_BIT + 1)) {
if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
return res;
}
}
/* shift by as many digits in the bit count */
if (b >= (int)DIGIT_BIT) {
if ((res ... | 2,944 |
= NULL) {
if (mp_init(cur_arg) != MP_OKAY) {
/* Oops - error! Back-track and mp_clear what we already
succeeded in init-ing, then return error.
*/
va_list clean_args;
/* end the current list */
va_end(args);
/* now start cl... | 2,944 |
= MP_OKAY) {
return res;
}
}
{
register mp_digit *top, *bottom;
/* increment the used by the shift amount then copy upwards */
a->used += b;
/* top */
top = a->dp + a->used - 1;
/* base */
bottom = a->dp + a->used - 1 - b;
/* much like mp_rshd this is implemented usi... | 2,944 |
= MP_OKAY) {
return res;
}
/* zero digits above the last digit of the modulus */
for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x used; x++) {
c->dp[x] = 0;
}
/* clear the digit that is not completely outside/inside the modulus */
c->dp[b / DIGIT_BIT] &=
(mp_digit) ((((mp_digit) 1) ... | 2,944 |
*/
static int
mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
{
mp_int q, x, y, t1, t2;
int res, n, t, i, norm, neg;
/* is divisor zero ? */
if (mp_iszero (b) == 1) {
return MP_VAL;
}
/* if a used + 2)) != MP_OKAY) {
return res;
}
q.used = a->used + 2;
if ((res = mp_init (&t1)... | 2,944 |
= MP_OKAY) {
goto LBL_Y;
}
}
/* reset y by shifting it back down */
mp_rshd (&y, n - t);
/* step 3. for i from n down to (t + 1) */
for (i = n; i >= (t + 1); i--) {
if (i > x.used) {
continue;
}
/* step 3.1 if xi == yt then set q{i-t-1} to b-1,
if (x.dp[i] == y.dp[t]) {
... | 2,944 |
= MP_OKAY) {
return err;
}
/* now init the second half of the array */
for (x = 1used - 1;
bitcpy = 0;
bitbuf = 0;
for (;;) {
/* grab next digit as required */
if (--bitcnt == 0) {
/* if digidx == -1 we are out of digits */
if (digidx == -1) {
break;
}
/* read ... | 2,944 |
*/
static int
mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d)
{
mp_int q;
int p, res;
if ((res = mp_init(&q)) != MP_OKAY) {
return res;
}
p = mp_count_bits(n);
top:
/* q = a/2**p, a = a mod 2**p */
if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) {
goto ERR;
}
/* q = q * d */... | 2,944 |
= MP_OKAY) {
return res;
}
/* set the used count of where the bit will go */
a->used = b / DIGIT_BIT + 1;
/* put the single bit in its place */
a->dp[b / DIGIT_BIT] = ((mp_digit)1) used * 2 * DIGIT_BIT)) != MP_OKAY) {
return res;
}
return mp_div (a, b, a, NULL);
}
/* reduces x mod m, assumes 0... | 2,944 |
.. }
*/
iy = MIN(a->used-tx, ty+1);
/* execute loop */
for (iz = 0; iz > ((mp_word)DIGIT_BIT);
}
/* setup dest */
olduse = c->used;
c->used = pa;
{
register mp_digit *tmpc;
tmpc = c->dp;
for (ix = 0; ix dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size);
if (a... | 2,944 |
dp + (2*ix + 1);
for (iy = ix + 1; iy dp[iy]);
/* now calculate the double precision result, note we use
*/
r = ((mp_word) *tmpt) + r + r + ((mp_word) u);
/* store lower part */
*tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
/* get carry */
u = (mp_digit)(... | 2,944 |
= MP_OKAY) {
return res;
}
t.used = a->used + b->used + 1;
pa = a->used;
pb = b->used;
for (ix = 0; ix dp[ix];
/* alias to the address of where the digits will be stored */
tmpt = &(t.dp[digs]);
/* alias for where to read the right hand side from */
tmpy = b->dp + (digs - ix);
for ... | 2,944 |
.a->used-1] */
for (ix = 0; ix used; ix++) {
*_W++ = *tmpx++;
}
/* zero the high words of W[a->used..m->used*2] */
for (; ix used * 2 + 1; ix++) {
*_W++ = 0;
}
}
/* now we proceed to zero successive digits
*/
for (ix = 0; ix used; ix++) {
/* mu = ai * m' mod b
*/
... | 2,944 |
= MP_LT) {
return s_mp_sub (x, n, x);
}
return MP_OKAY;
}
#endif
#ifdef BN_MP_MUL_2_C
/* b = a*2 */
static int
mp_mul_2(mp_int * a, mp_int * b)
{
int x, res, oldused;
/* grow to accommodate result */
if (b->alloc used + 1) {
if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) {
return res;
... | 2,944 |
= MP_OKAY) {
return res;
}
} else {
mp_set(a, 1);
bits = 1;
}
/* now compute C = A * B mod b */
for (x = bits - 1; x 5) {
winsize = 5;
}
#endif
/* init M array */
/* init first cell */
if ((err = mp_init(&M[1])) != MP_OKAY) {
return err;
}
/* now init the second... | 2,944 |
.. }
*/
iy = MIN(a->used-tx, ty+1);
/* now for squaring tx can never equal ty
*/
iy = MIN(iy, (ty-tx+1)>>1);
/* execute loop */
for (iz = 0; iz dp[ix>>1])*((mp_word)a->dp[ix>>1]);
}
/* store it */
W[ix] = (mp_digit)(_W & MP_MASK);
/* make next carr... | 2,944 |
/*
*/
#ifndef TLSV1_CLIENT_H
#define TLSV1_CLIENT_H
#include "tlsv1_cred.h"
struct tlsv1_client;
int tlsv1_client_global_init(void);
void tlsv1_client_global_deinit(void);
struct tlsv1_client * tlsv1_client_init(void);
void tlsv1_client_deinit(struct tlsv1_client *conn);
int tlsv1_client_established(struct tlsv1_c... | 2,945 |
/*
*/
#ifndef RSA_H
#define RSA_H
struct crypto_rsa_key;
struct crypto_rsa_key *
crypto_rsa_import_public_key(const u8 *buf, size_t len);
struct crypto_rsa_key *
crypto_rsa_import_public_key_parts(const u8 *n, size_t n_len,
const u8 *e, size_t e_len);
struct crypto_rsa_key *
crypto_rsa_import_private_key(con... | 2,946 |
/*
*/
#ifndef BIGNUM_H
#define BIGNUM_H
struct bignum;
struct bignum * bignum_init(void);
void bignum_deinit(struct bignum *n);
size_t bignum_get_unsigned_bin_len(struct bignum *n);
int bignum_get_unsigned_bin(const struct bignum *n, u8 *buf, size_t *len);
int bignum_set_unsigned_bin(struct bignum *n, const u8 *buf... | 2,947 |
/*
*/
#ifndef EAP_WSC_COMMON_H
#define EAP_WSC_COMMON_H
#define EAP_VENDOR_TYPE_WSC 1
#define WSC_FLAGS_MF 0x01
#define WSC_FLAGS_LF 0x02
#define WSC_ID_REGISTRAR "WFA-SimpleConfig-Registrar-1-0"
#define WSC_ID_REGISTRAR_LEN 30
#define WSC_ID_ENROLLEE "WFA-SimpleConfig-Enrollee-1-0"
#define WSC_ID_ENROLLEE_LEN 29
... | 2,948 |
/*
*/
#ifndef WPA_H
#define WPA_H
#include "sdkconfig.h"
#include "utils/common.h"
#include "utils/includes.h"
#include "common/defs.h"
#include "common/wpa_common.h"
#include "esp_wifi_types.h"
#include "esp_wifi_crypto_types.h"
#include "wpa_i.h"
struct wpa_sm;
extern struct wpa_sm gWpaSm;
#define WPA_SM_STATE(_... | 2,949 |
/*
*/
#ifndef PMKSA_CACHE_H
#define PMKSA_CACHE_H
/**
*/
struct rsn_pmksa_cache_entry {
struct rsn_pmksa_cache_entry *next;
u8 pmkid[PMKID_LEN];
u8 pmk[PMK_LEN_MAX];
size_t pmk_len;
os_time_t expiration;
int akmp; /* WPA_KEY_MGMT_* */
u8 aa[ETH_ALEN];
os_time_t reauth_time;
/**... | 2,950 |
/*
*/
#ifndef WPA_I_H
#define WPA_I_H
extern struct wpa_sm gWpaSm;
#define DEFAULT_EAPOL_VERSION 1
struct install_key {
int keys_cleared;
enum wpa_alg alg;
u8 addr[ETH_ALEN];
int key_idx;
int set_tx;
u8 seq[10];
u8 key[32];
};
/**
*/
struct wpa_sm {
u8 pmk[PMK_LEN_MAX];
size_t ... | 2,951 |
/*
*/
#ifndef WPA_IE_H
#define WPA_IE_H
struct wpa_eapol_ie_parse {
const u8 *wpa_ie;
size_t wpa_ie_len;
const u8 *rsn_ie;
size_t rsn_ie_len;
const u8 *pmkid;
const u8 *gtk;
size_t gtk_len;
const u8 *mac_addr;
size_t mac_addr_len;
#ifdef CONFIG_IEEE80211W
const u8 *igtk;
size_t igtk_len;
#endif /* CONFIG_... | 2,952 |
/*
*/
#ifndef __BTC_CONFIG_H__
#define __BTC_CONFIG_H__
#include
#include
#include "stack/bt_types.h"
typedef struct btc_config_section_iter_t btc_config_section_iter_t;
bool btc_config_init(void);
bool btc_config_shut_down(void);
bool btc_config_clean_up(void);
bool btc_config_has_section(const char *section)... | 2,953 |
..we need to move these out. These are peer specific, not config general.
bool btc_get_address_type(const BD_ADDR bd_addr, int *p_addr_type);
bool btc_compare_address_key_value(const char *section, const char *key_type, void *key_value, int key_length);
bool btc_get_device_type(const BD_ADDR bd_addr, int *p_device_type... | 2,953 |
/*
*/
#ifndef __BTC_UTIL_H__
#define __BTC_UTIL_H__
#include
#include "stack/bt_types.h"
#include "common/bt_defs.h"
#include "esp_bt_defs.h"
#include "esp_hf_defs.h"
/
** Constants & Macros
/
#define CASE_RETURN_STR(const) case const: return #const;
/
** Type definitions for callback functions
/
typedef char b... | 2,954 |
/*
*/
#ifndef __BTC_DEV_H__
#define __BTC_DEV_H__
#include "esp_bt_defs.h"
#include "esp_bt_device.h"
#include "btc/btc_task.h"
typedef enum {
BTC_DEV_ACT_SET_DEVICE_NAME,
BTC_DEV_ACT_GET_DEVICE_NAME,
#if (ESP_COEX_VSC_INCLUDED == TRUE)
BTC_DEV_ACT_CFG_COEX_STATUS,
#endif
BTC_DEV_ACT_VENDOR_HCI_CMD_... | 2,955 |
/*
*/
#ifndef __BTC_DM_H__
#define __BTC_DM_H__
#include "btc/btc_task.h"
#include "esp_bt_defs.h"
#include "bta/bta_api.h"
typedef enum {
BTC_DM_SEC_ACT
} btc_dm_sec_act_t;
/* btc_dm_args_t */
typedef union {
//BTC_DM_SEC_ACT
tBTA_DM_SEC sec;
} btc_dm_sec_args_t;
typedef struct
{
bool ... | 2,956 |
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... | 2,957 |
/*
*/
/
#ifndef __BTC_PROFILE_QUEUE_H__
#define __BTC_PROFILE_QUEUE_H__
#include "common/bt_defs.h"
#include "btc/btc_task.h"
typedef enum {
BTC_PRF_QUE_CONNECT = 0,
BTC_PRF_QUE_ADVANCE
} btc_prf_que_act_t;
typedef bt_status_t (*btc_connect_cb_t) (bt_bdaddr_t *bda, uint16_t uuid);
typedef struct connect_... | 2,958 |
/*
*/
#ifndef __BTC_COMMON_H__
#define __BTC_COMMON_H__
#include
#include "common/bt_trace.h"
#include "stack/bt_types.h"
#include "osi/osi.h"
#define BTC_ASSERTC(cond, msg, val) assert(cond && msg)
#define BTC_HAL_CBACK(P_CB, P_CBACK, ...)\
if (P_CB && P_CB->P_CBACK) { \
LOG_INFO("HAL %s-... | 2,959 |
/*
*/
#ifndef __BTC_STORAGE_H__
#define __BTC_STORAGE_H__
#include
#include "common/bt_defs.h"
#include "stack/bt_types.h"
#include "esp_gap_bt_api.h"
#define BTC_STORAGE_DEV_CLASS_STR "DevClass"
#define BTC_STORAGE_LINK_KEY_STR "LinkKey" /* same as the ble */
#define BTC_STORAGE_LINK_KEY_TYPE_STR... | 2,960 |
** Additionally, this API also invokes the adaper_properties_cb
** and remote_device_properties_cb for each of the bonded devices.
**
** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
**
/
bt_status_t btc_storage_load_bonded_devices(void);
/
**
** Function... | 2,960 |
The updates will
** not be stored into NVRAM immediately.
**
** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
**
/
bool btc_storage_update_active_device(bt_bdaddr_t *remote_bd_addr);
#if (defined BTC_HH_INCLUDED && BTC_HH_INCLUDED == TRUE)
/
bt_status_t btc_storage_add_h... | 2,960 |
/*
*/
/
#ifndef __BTC_SM_H__
#define __BTC_SM_H__
/
** Constants & Macros
/
/* Generic Enter/Exit state machine events */
#define BTC_SM_ENTER_EVT 0xFFFF
#define BTC_SM_EXIT_EVT 0xFFFE
/
** Type definitions and return values
/
typedef UINT32 btc_sm_state_t;
typedef UINT32 btc_sm_event_t;
typedef void *btc_sm... | 2,961 |
The 'BTC_SM_EXIT_EVT'
** shall be invoked before exiting the current state. The
** 'BTC_SM_ENTER_EVT' shall be invoked before entering the new state
**
**
** Returns Returns BT_STATUS_OK on success, BT_STATUS_FAIL otherwise
**
/
bt_status_t btc_sm_change_state(btc_sm_handle_t handle, btc... | 2,961 |
/*
*/
#ifndef __BTC_BT_MAIN_H__
#define __BTC_BT_MAIN_H__
#include "osi/future.h"
#include "stack/bt_types.h"
#include "bta/bta_api.h"
#include "btc/btc_main.h"
#include "btc/btc_task.h"
typedef enum {
BTC_MAIN_ACT_INIT = 0,
BTC_MAIN_ACT_DEINIT,
BTC_MAIN_ACT_ENABLE,
BTC_MAIN_ACT_DISABLE,
} btc_main_... | 2,962 |
#include "prf_defs.h"
/*
*/
#if (BUT_PROFILE_CFG)
#include "common/bt_target.h"
#include "stack/gatt_api.h"
#include "stack/gattdefs.h"
#include "esp_gatt_api.h"
#define KEY_SUCCESS GATT_SUCCESS
#define KEY_ILLEGAL_PARAM GATT_ILLEGAL_PARAMETER
#define KEY_NO_RESOURCES GATT_NO_RESOURCES
//d... | 2,963 |
/*
*/
#include "prf_defs.h"
#if (WX_AIRSYNC_CFG)
#include "common/bt_target.h"
#include "stack/gatt_api.h"
#include "stack/gattdefs.h"
#include "bt_app_api.h"
/// Maximum Transmission Unit
#define ATT_DEFAULT_MTU (23)
#define BLE_WECHAT_MAX_DATA_LEN (ATT_DEFAULT_MTU - 3... | 2,964 |
/*
*/
/
#ifndef __BTC_A2DP_SINK_H__
#define __BTC_A2DP_SINK_H__
#include
#include "common/bt_target.h"
#include "bta/bta_api.h"
#include "btc_av_api.h"
#include "esp_a2dp_api.h"
#if BTC_AV_SINK_INCLUDED
/
** Data types
/
typedef struct {
BT_HDR hdr;
UINT8 codec_info[AVDT_CODEC_SIZE];
} tBTC_MEDIA_SINK_... | 2,965 |
**
** Returns size of the queue
**
/
UINT8 btc_a2dp_sink_enque_buf(BT_HDR *p_buf);
/
**
** Function btc_a2dp_sink_on_idle
**
** Description Process 'idle' request from the BTC AV state machine during
** initialization
**
/
void btc_a2dp_sink_on_idle(void);
/
**
**... | 2,965 |
/*
*/
#ifndef __BTC_GATT_COMMON_H__
#define __BTC_GATT_COMMON_H__
#include "osi/future.h"
#include "stack/bt_types.h"
#include "bta/bta_api.h"
#include "btc/btc_main.h"
#include "btc/btc_task.h"
typedef enum {
BTC_GATT_ACT_SET_LOCAL_MTU = 0,
} btc_gatt_com_act_t;
/* btc_ble_gattc_args_t */
typedef union {
... | 2,966 |
/*
*/
#ifndef __BTC_GATTC_H__
#define __BTC_GATTC_H__
#include "btc/btc_task.h"
#include "esp_bt_defs.h"
#include "esp_gatt_defs.h"
#include "esp_gattc_api.h"
typedef enum {
BTC_GATTC_ACT_APP_REGISTER = 0,
BTC_GATTC_ACT_APP_UNREGISTER,
BTC_GATTC_ACT_OPEN,
#if (BLE_50_FEATURE_SUPPORT == TRUE)
BTC_GAT... | 2,967 |
/*
*/
#ifndef __BTC_AVRC_H__
#define __BTC_AVRC_H__
#include
#include
#include "common/bt_defs.h"
#include "stack/bt_types.h"
#include "bta/bta_av_api.h"
#include "btc/btc_task.h"
#include "esp_avrc_api.h"
#if (BTC_AV_INCLUDED == TRUE)
#ifndef BTC_AVRC_TGT_INCLUDED
#define BTC_AVRC_TGT_INCLUDED FALSE
#endif
... | 2,968 |
4 need to change this */
#define BTC_RC_CT_INIT_MAGIC 0x20181128
#define BTC_RC_TG_INIT_MAGIC 0x20181129
#define MAX_RC_NOTIFICATIONS (13) // refer to ESP_AVRC_RN_MAX_EVT
#define CHECK_ESP_RC_CONNECTED do { \
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__); \
if (btc... | 2,968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.