Lines Matching refs:operation

128 static psa_status_t psa_pake_ecjpake_setup(mbedtls_psa_pake_operation_t *operation)
132 mbedtls_ecjpake_init(&operation->ctx.jpake);
134 ret = mbedtls_ecjpake_setup(&operation->ctx.jpake,
135 operation->role,
138 operation->password,
139 operation->password_len);
141 mbedtls_platform_zeroize(operation->password, operation->password_len);
155 psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation,
184 operation->password = mbedtls_calloc(1, password_len);
185 if (operation->password == NULL) {
202 status = psa_crypto_driver_pake_get_password(inputs, operation->password,
220 operation->password_len = actual_password_len;
221 operation->alg = cipher_suite.algorithm;
242 operation->role = MBEDTLS_ECJPAKE_CLIENT;
246 operation->role = MBEDTLS_ECJPAKE_SERVER;
252 operation->buffer_length = 0;
253 operation->buffer_offset = 0;
255 status = psa_pake_ecjpake_setup(operation);
266 (void) operation;
273 /* In case of failure of the setup of a multipart operation, the PSA driver interface
278 mbedtls_psa_pake_abort(operation);
283 mbedtls_psa_pake_operation_t *operation,
308 if (operation->alg == PSA_ALG_JPAKE) {
311 ret = mbedtls_ecjpake_write_round_one(&operation->ctx.jpake,
312 operation->buffer,
313 sizeof(operation->buffer),
314 &operation->buffer_length,
321 operation->buffer_offset = 0;
323 ret = mbedtls_ecjpake_write_round_two(&operation->ctx.jpake,
324 operation->buffer,
325 sizeof(operation->buffer),
326 &operation->buffer_length,
333 operation->buffer_offset = 0;
348 operation->role == MBEDTLS_ECJPAKE_SERVER) {
350 operation->buffer_offset += 3;
354 length = operation->buffer[operation->buffer_offset];
355 operation->buffer_offset += 1;
357 if (operation->buffer_offset + length > operation->buffer_length) {
366 operation->buffer + operation->buffer_offset,
370 operation->buffer_offset += length;
375 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer));
376 operation->buffer_length = 0;
377 operation->buffer_offset = 0;
391 psa_status_t mbedtls_psa_pake_output(mbedtls_psa_pake_operation_t *operation,
398 operation, step, output, output_size, output_length);
404 mbedtls_psa_pake_operation_t *operation,
428 if (operation->alg == PSA_ALG_JPAKE) {
439 operation->role == MBEDTLS_ECJPAKE_CLIENT) {
447 if (operation->buffer_length + sizeof(ecparameters) >
448 sizeof(operation->buffer)) {
452 memcpy(operation->buffer + operation->buffer_length,
454 operation->buffer_length += sizeof(ecparameters);
462 if (operation->buffer_length + input_length + 1 > sizeof(operation->buffer)) {
467 operation->buffer[operation->buffer_length] = (uint8_t) input_length;
468 operation->buffer_length += 1;
471 memcpy(operation->buffer + operation->buffer_length,
473 operation->buffer_length += input_length;
477 ret = mbedtls_ecjpake_read_round_one(&operation->ctx.jpake,
478 operation->buffer,
479 operation->buffer_length);
481 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer));
482 operation->buffer_length = 0;
488 ret = mbedtls_ecjpake_read_round_two(&operation->ctx.jpake,
489 operation->buffer,
490 operation->buffer_length);
492 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer));
493 operation->buffer_length = 0;
510 psa_status_t mbedtls_psa_pake_input(mbedtls_psa_pake_operation_t *operation,
516 operation, step, input, input_length);
522 mbedtls_psa_pake_operation_t *operation,
529 if (operation->alg == PSA_ALG_JPAKE) {
530 ret = mbedtls_ecjpake_write_shared_key(&operation->ctx.jpake,
548 psa_status_t mbedtls_psa_pake_abort(mbedtls_psa_pake_operation_t *operation)
550 mbedtls_zeroize_and_free(operation->password, operation->password_len);
551 operation->password = NULL;
552 operation->password_len = 0;
555 if (operation->alg == PSA_ALG_JPAKE) {
556 operation->role = MBEDTLS_ECJPAKE_NONE;
557 mbedtls_platform_zeroize(operation->buffer, sizeof(operation->buffer));
558 operation->buffer_length = 0;
559 operation->buffer_offset = 0;
560 mbedtls_ecjpake_free(&operation->ctx.jpake);
564 operation->alg = PSA_ALG_NONE;