Lines Matching defs:tls
410 t4_tls_key_info_size(const struct ktls_session *tls)
415 tls->params.cipher_key_len;
416 if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) {
419 switch (tls->params.auth_algorithm) {
438 t4_tls_proto_ver(const struct ktls_session *tls)
440 switch (tls->params.tls_vminor) {
453 t4_tls_cipher_mode(const struct ktls_session *tls)
455 switch (tls->params.cipher_algorithm) {
466 t4_tls_auth_mode(const struct ktls_session *tls)
468 switch (tls->params.cipher_algorithm) {
470 switch (tls->params.auth_algorithm) {
488 t4_tls_hmac_ctrl(const struct ktls_session *tls)
490 switch (tls->params.cipher_algorithm) {
501 tls_seqnum_ctrl(const struct ktls_session *tls)
503 switch (tls->params.tls_vminor) {
512 tls_cipher_key_size(const struct ktls_session *tls)
514 switch (tls->params.cipher_key_len) {
527 tls_mac_key_size(const struct ktls_session *tls)
529 if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16)
532 switch (tls->params.auth_algorithm) {
546 t4_tls_key_ctx(const struct ktls_session *tls, int direction,
555 kctx->u.txhdr.ctxlen = t4_tls_key_info_size(tls) / 16;
558 V_TLS_KEYCTX_TX_WR_TXCK_SIZE(tls_cipher_key_size(tls)) |
559 V_TLS_KEYCTX_TX_WR_TXMK_SIZE(tls_mac_key_size(tls)) |
561 if (tls->params.cipher_algorithm == CRYPTO_AES_CBC)
568 V_TLS_KEYCTX_TX_WR_FLITCNT(t4_tls_key_info_size(tls) / 16) |
569 V_TLS_KEYCTX_TX_WR_HMACCTRL(t4_tls_hmac_ctrl(tls));
572 V_TLS_KEYCTX_TX_WR_PROTOVER(t4_tls_proto_ver(tls)) |
573 V_TLS_KEYCTX_TX_WR_CIPHMODE(t4_tls_cipher_mode(tls));
576 V_TLS_KEYCTX_TX_WR_AUTHMODE(t4_tls_auth_mode(tls)) |
577 V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(tls_seqnum_ctrl(tls)) |
582 V_TLS_KEYCTX_TX_WR_RXCK_SIZE(tls_cipher_key_size(tls)) |
583 V_TLS_KEYCTX_TX_WR_RXMK_SIZE(tls_mac_key_size(tls));
585 if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) {
614 tls->params.cipher_algorithm == CRYPTO_AES_CBC)
615 t4_aes_getdeckey(kctx->keys.edkey, tls->params.cipher_key,
616 tls->params.cipher_key_len * 8);
618 memcpy(kctx->keys.edkey, tls->params.cipher_key,
619 tls->params.cipher_key_len);
622 hash = kctx->keys.edkey + tls->params.cipher_key_len;
623 if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) {
627 memcpy(kctx->u.txhdr.txsalt, tls->params.iv,
628 tls->params.iv_len);
629 t4_init_gmac_hash(tls->params.cipher_key,
630 tls->params.cipher_key_len, hash);
632 switch (tls->params.auth_algorithm) {
648 t4_init_hmac_digest(axf, mac_key_size, tls->params.auth_key,
649 tls->params.auth_key_len, hash);
675 t4_write_tlskey_wr(const struct ktls_session *tls, int direction, int tid,
681 kwr->protocol = t4_tls_proto_ver(tls);
682 kwr->mfs = htobe16(tls->params.max_frame_len);