Lines Matching defs:gcm_ctx
308 ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx,
313 if (gcm_ctx != NULL) {
314 CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)aes_hw_encrypt, 1);
324 if (gcm_ctx != NULL) {
325 CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0);
338 if (gcm_ctx != NULL) {
339 CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)vpaes_encrypt, 0);
345 if (gcm_ctx != NULL) {
346 CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0);
886 static int aead_aes_gcm_init_impl(struct aead_aes_gcm_ctx *gcm_ctx,
905 gcm_ctx->ctr =
906 aes_ctr_set_key(&gcm_ctx->ks.ks, &gcm_ctx->gcm, NULL, key, key_len);
913 struct aead_aes_gcm_ctx *gcm_ctx;
914 gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_ctx));
915 if (gcm_ctx == NULL) {
920 if (!aead_aes_gcm_init_impl(gcm_ctx, &actual_tag_len, key, key_len,
922 OPENSSL_free(gcm_ctx);
926 ctx->aead_state = gcm_ctx;
943 const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state;
959 const AES_KEY *key = &gcm_ctx->ks.ks;
961 OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm));
968 if (gcm_ctx->ctr) {
970 gcm_ctx->ctr)) {
980 if (gcm_ctx->ctr) {
982 extra_in_len, gcm_ctx->ctr)) {
1003 const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state;
1017 const AES_KEY *key = &gcm_ctx->ks.ks;
1019 OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm));
1026 if (gcm_ctx->ctr) {
1028 gcm_ctx->ctr)) {
1077 struct aead_aes_gcm_ctx gcm_ctx;
1083 struct aead_aes_gcm_tls12_ctx *gcm_ctx;
1084 gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_tls12_ctx));
1085 if (gcm_ctx == NULL) {
1089 gcm_ctx->min_next_nonce = 0;
1092 if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len,
1094 OPENSSL_free(gcm_ctx);
1098 ctx->aead_state = gcm_ctx;
1108 struct aead_aes_gcm_tls12_ctx *gcm_ctx = ctx->aead_state;
1120 given_counter < gcm_ctx->min_next_nonce) {
1125 gcm_ctx->min_next_nonce = given_counter + 1;
1163 struct aead_aes_gcm_ctx gcm_ctx;
1171 struct aead_aes_gcm_tls13_ctx *gcm_ctx;
1172 gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_tls13_ctx));
1173 if (gcm_ctx == NULL) {
1177 gcm_ctx->min_next_nonce = 0;
1178 gcm_ctx->first = 1;
1181 if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len,
1183 OPENSSL_free(gcm_ctx);
1187 ctx->aead_state = gcm_ctx;
1197 struct aead_aes_gcm_tls13_ctx *gcm_ctx = ctx->aead_state;
1211 if (gcm_ctx->first) {
1214 gcm_ctx->mask = given_counter;
1215 gcm_ctx->first = 0;
1217 given_counter ^= gcm_ctx->mask;
1220 given_counter < gcm_ctx->min_next_nonce) {
1225 gcm_ctx->min_next_nonce = given_counter + 1;