Lines Matching refs:alg
72 size_t qcrypto_cipher_get_block_len(QCryptoCipherAlgorithm alg) in qcrypto_cipher_get_block_len() argument
74 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_block_len()
75 return alg_block_len[alg]; in qcrypto_cipher_get_block_len()
79 size_t qcrypto_cipher_get_key_len(QCryptoCipherAlgorithm alg) in qcrypto_cipher_get_key_len() argument
81 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_key_len()
82 return alg_key_len[alg]; in qcrypto_cipher_get_key_len()
86 size_t qcrypto_cipher_get_iv_len(QCryptoCipherAlgorithm alg, in qcrypto_cipher_get_iv_len() argument
89 if (alg >= G_N_ELEMENTS(alg_block_len)) { in qcrypto_cipher_get_iv_len()
97 return alg_block_len[alg]; in qcrypto_cipher_get_iv_len()
104 qcrypto_cipher_validate_key_length(QCryptoCipherAlgorithm alg, in qcrypto_cipher_validate_key_length() argument
109 if ((unsigned)alg >= QCRYPTO_CIPHER_ALG__MAX) { in qcrypto_cipher_validate_key_length()
111 alg); in qcrypto_cipher_validate_key_length()
116 if (alg == QCRYPTO_CIPHER_ALG_DES || in qcrypto_cipher_validate_key_length()
117 alg == QCRYPTO_CIPHER_ALG_3DES) { in qcrypto_cipher_validate_key_length()
126 if (alg_key_len[alg] != (nkey / 2)) { in qcrypto_cipher_validate_key_length()
128 nkey, alg_key_len[alg] * 2); in qcrypto_cipher_validate_key_length()
132 if (alg_key_len[alg] != nkey) { in qcrypto_cipher_validate_key_length()
134 nkey, alg_key_len[alg]); in qcrypto_cipher_validate_key_length()
151 QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, in qcrypto_cipher_new() argument
159 cipher = qcrypto_afalg_cipher_ctx_new(alg, mode, key, nkey, NULL); in qcrypto_cipher_new()
163 cipher = qcrypto_cipher_ctx_new(alg, mode, key, nkey, errp); in qcrypto_cipher_new()
169 cipher->alg = alg; in qcrypto_cipher_new()