Lines Matching refs:scratch
1086 HN_UBASE *scratch) in _nx_crypto_ec_point_fp_projective_to_affine() argument
1102 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp1, scratch, buffer_size << 1); in _nx_crypto_ec_point_fp_projective_to_affine()
1103 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp2, scratch, buffer_size << 1); in _nx_crypto_ec_point_fp_projective_to_affine()
1104 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&zi, scratch, buffer_size); in _nx_crypto_ec_point_fp_projective_to_affine()
1108 p, &zi, scratch); in _nx_crypto_ec_point_fp_projective_to_affine()
1111 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &zi, &temp1, scratch); in _nx_crypto_ec_point_fp_projective_to_affine()
1113 &temp1, &temp2, scratch); in _nx_crypto_ec_point_fp_projective_to_affine()
1117 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &zi, &temp1, &temp2, scratch); in _nx_crypto_ec_point_fp_projective_to_affine()
1119 &temp2, &temp1, scratch); in _nx_crypto_ec_point_fp_projective_to_affine()
1185 HN_UBASE *scratch) in _nx_crypto_ec_secp192r1_reduce() argument
1204 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp, scratch, 36); in _nx_crypto_ec_secp192r1_reduce()
1206 data = (UINT *)(((ULONG)scratch + 3) & (ULONG) ~3); in _nx_crypto_ec_secp192r1_reduce()
1322 HN_UBASE *scratch) in _nx_crypto_ec_secp224r1_reduce() argument
1341 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp, scratch, 36); in _nx_crypto_ec_secp224r1_reduce()
1343 data = (UINT *)(((ULONG)scratch + 3) & (ULONG) ~3); in _nx_crypto_ec_secp224r1_reduce()
1465 HN_UBASE *scratch) in _nx_crypto_ec_secp256r1_reduce() argument
1485 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp, scratch, 36); in _nx_crypto_ec_secp256r1_reduce()
1487 data = (UINT *)(((ULONG)scratch + 3) & (ULONG) ~3); in _nx_crypto_ec_secp256r1_reduce()
1630 HN_UBASE *scratch) in _nx_crypto_ec_secp384r1_reduce() argument
1650 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp, scratch, 52); in _nx_crypto_ec_secp384r1_reduce()
1652 data = (UINT *)(((ULONG)scratch + 3) & (ULONG) ~3); in _nx_crypto_ec_secp384r1_reduce()
1803 HN_UBASE *scratch) in _nx_crypto_ec_secp521r1_reduce() argument
1821 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp, scratch, 66); in _nx_crypto_ec_secp521r1_reduce()
1823 data = (UCHAR *)(((ULONG)scratch + 3) & (ULONG) ~3); in _nx_crypto_ec_secp521r1_reduce()
1922 HN_UBASE *scratch) in _nx_crypto_ec_add_digit_reduce() argument
1924 NX_CRYPTO_PARAMETER_NOT_USED(scratch); in _nx_crypto_ec_add_digit_reduce()
1986 HN_UBASE *scratch) in _nx_crypto_ec_subtract_digit_reduce() argument
1988 NX_CRYPTO_PARAMETER_NOT_USED(scratch); in _nx_crypto_ec_subtract_digit_reduce()
2046 HN_UBASE *scratch) in _nx_crypto_ec_fp_reduce() argument
2048 NX_CRYPTO_PARAMETER_NOT_USED(scratch); in _nx_crypto_ec_fp_reduce()
2109 HN_UBASE *scratch) in _nx_crypto_ec_add_reduce() argument
2111 NX_CRYPTO_PARAMETER_NOT_USED(scratch); in _nx_crypto_ec_add_reduce()
2183 HN_UBASE *scratch) in _nx_crypto_ec_subtract_reduce() argument
2185 NX_CRYPTO_PARAMETER_NOT_USED(scratch); in _nx_crypto_ec_subtract_reduce()
2256 HN_UBASE *scratch) in _nx_crypto_ec_fp_projective_add() argument
2288 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp1, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_add()
2289 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp2, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_add()
2290 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp3, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_add()
2291 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp4, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_add()
2292 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp5, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_add()
2297 &temp1, scratch); in _nx_crypto_ec_fp_projective_add()
2299 &temp1, &temp2, scratch); in _nx_crypto_ec_fp_projective_add()
2301 scratch); in _nx_crypto_ec_fp_projective_add()
2307 &temp1, &temp3, scratch); in _nx_crypto_ec_fp_projective_add()
2309 &temp3, &temp1, scratch); in _nx_crypto_ec_fp_projective_add()
2311 scratch); in _nx_crypto_ec_fp_projective_add()
2316 &temp2, &temp3, scratch); in _nx_crypto_ec_fp_projective_add()
2322 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &temp2, &temp3, scratch); in _nx_crypto_ec_fp_projective_add()
2323 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp2, &temp3, &temp4, scratch); in _nx_crypto_ec_fp_projective_add()
2325 &temp3, &temp2, scratch); in _nx_crypto_ec_fp_projective_add()
2327 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp3, 1, scratch); in _nx_crypto_ec_fp_projective_add()
2328 _nx_crypto_ec_add_reduce(curve, &temp3, &temp4, scratch); in _nx_crypto_ec_fp_projective_add()
2329 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &temp1, &temp5, scratch); in _nx_crypto_ec_fp_projective_add()
2330 _nx_crypto_ec_subtract_reduce(curve, &temp5, &temp3, scratch); in _nx_crypto_ec_fp_projective_add()
2338 _nx_crypto_ec_subtract_reduce(curve, &temp2, &temp5, scratch); in _nx_crypto_ec_fp_projective_add()
2339 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp1, &temp2, &temp3, scratch); in _nx_crypto_ec_fp_projective_add()
2341 &temp4, &temp1, scratch); in _nx_crypto_ec_fp_projective_add()
2342 _nx_crypto_ec_subtract_reduce(curve, &temp3, &temp1, scratch); in _nx_crypto_ec_fp_projective_add()
2405 HN_UBASE *scratch) in _nx_crypto_ec_fp_projective_double() argument
2427 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp1, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_double()
2428 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp2, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_double()
2429 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp3, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_double()
2430 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp4, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_double()
2431 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp5, scratch, buffer_size << 1); in _nx_crypto_ec_fp_projective_double()
2435 &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2437 &temp3, &temp1, scratch); in _nx_crypto_ec_fp_projective_double()
2438 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp1, 2, scratch); in _nx_crypto_ec_fp_projective_double()
2442 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &temp3, &temp2, scratch); in _nx_crypto_ec_fp_projective_double()
2443 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp2, 3, scratch); in _nx_crypto_ec_fp_projective_double()
2447 &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2450 _nx_crypto_ec_subtract_reduce(curve, &temp4, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2451 _nx_crypto_ec_add_reduce(curve, &temp5, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2452 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp4, &temp5, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2453 NX_CRYPTO_EC_MULTIPLE_DIGIT_REDUCE(curve, &temp3, 3, &temp4, scratch); in _nx_crypto_ec_fp_projective_double()
2457 &projective_point -> nx_crypto_ec_point_z, &temp5, scratch); in _nx_crypto_ec_fp_projective_double()
2458 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp5, 1, scratch); in _nx_crypto_ec_fp_projective_double()
2464 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &temp4, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2466 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp5, 1, scratch); in _nx_crypto_ec_fp_projective_double()
2467 _nx_crypto_ec_subtract_reduce(curve, &temp3, &temp5, scratch); in _nx_crypto_ec_fp_projective_double()
2475 _nx_crypto_ec_subtract_reduce(curve, &temp1, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2476 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp1, &temp4, &temp3, scratch); in _nx_crypto_ec_fp_projective_double()
2477 _nx_crypto_ec_subtract_reduce(curve, &temp3, &temp2, scratch); in _nx_crypto_ec_fp_projective_double()
2543 HN_UBASE *scratch) in _nx_crypto_ec_fp_affine_add() argument
2566 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp1, scratch, buffer_size << 1); in _nx_crypto_ec_fp_affine_add()
2567 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp2, scratch, buffer_size << 1); in _nx_crypto_ec_fp_affine_add()
2568 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&temp3, scratch, buffer_size << 1); in _nx_crypto_ec_fp_affine_add()
2579 NX_CRYPTO_EC_SHIFT_LEFT_REDUCE(curve, &temp3, 1, scratch); in _nx_crypto_ec_fp_affine_add()
2580 _nx_crypto_huge_number_inverse_modulus_prime(&temp3, p, &temp1, scratch); in _nx_crypto_ec_fp_affine_add()
2582 &temp3, scratch); in _nx_crypto_ec_fp_affine_add()
2583 NX_CRYPTO_EC_MULTIPLE_DIGIT_REDUCE(curve, &temp3, 3, &temp2, scratch); in _nx_crypto_ec_fp_affine_add()
2584 _nx_crypto_ec_subtract_digit_reduce(curve, &temp2, 3, scratch); in _nx_crypto_ec_fp_affine_add()
2585 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp2, &temp1, &temp3, scratch); in _nx_crypto_ec_fp_affine_add()
2593 _nx_crypto_ec_subtract_reduce(curve, &temp1, &left -> nx_crypto_ec_point_x, scratch); in _nx_crypto_ec_fp_affine_add()
2594 _nx_crypto_huge_number_inverse_modulus_prime(&temp1, p, &temp2, scratch); in _nx_crypto_ec_fp_affine_add()
2596 _nx_crypto_ec_subtract_reduce(curve, &temp1, &left -> nx_crypto_ec_point_y, scratch); in _nx_crypto_ec_fp_affine_add()
2597 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp1, &temp2, &temp3, scratch); in _nx_crypto_ec_fp_affine_add()
2601 NX_CRYPTO_EC_SQUARE_REDUCE(curve, &temp3, &temp1, scratch); in _nx_crypto_ec_fp_affine_add()
2602 _nx_crypto_ec_subtract_reduce(curve, &temp1, &left -> nx_crypto_ec_point_x, scratch); in _nx_crypto_ec_fp_affine_add()
2603 _nx_crypto_ec_subtract_reduce(curve, &temp1, &right -> nx_crypto_ec_point_x, scratch); in _nx_crypto_ec_fp_affine_add()
2608 _nx_crypto_ec_subtract_reduce(curve, &temp2, &temp1, scratch); in _nx_crypto_ec_fp_affine_add()
2609 NX_CRYPTO_EC_MULTIPLE_REDUCE(curve, &temp2, &temp3, &temp1, scratch); in _nx_crypto_ec_fp_affine_add()
2610 _nx_crypto_ec_subtract_reduce(curve, &temp1, &left -> nx_crypto_ec_point_y, scratch); in _nx_crypto_ec_fp_affine_add()
2665 HN_UBASE *scratch) in _nx_crypto_ec_fp_affine_subtract() argument
2669 NX_CRYPTO_EC_POINT_INITIALIZE(&point, NX_CRYPTO_EC_POINT_AFFINE, scratch, in _nx_crypto_ec_fp_affine_subtract()
2675 &right -> nx_crypto_ec_point_y, scratch); in _nx_crypto_ec_fp_affine_subtract()
2676 _nx_crypto_ec_fp_affine_add(curve, left, &point, scratch); in _nx_crypto_ec_fp_affine_subtract()
2870 HN_UBASE *scratch) in _nx_crypto_ec_fp_projective_multiple() argument
2883 _nx_crypto_ec_fp_fixed_multiple(curve, d, r, scratch); in _nx_crypto_ec_fp_projective_multiple()
2887 NX_CRYPTO_EC_POINT_INITIALIZE(&projective_point, NX_CRYPTO_EC_POINT_PROJECTIVE, scratch, in _nx_crypto_ec_fp_projective_multiple()
2889 NX_CRYPTO_EC_POINT_INITIALIZE(&negative_g, NX_CRYPTO_EC_POINT_AFFINE, scratch, in _nx_crypto_ec_fp_projective_multiple()
2896 &g -> nx_crypto_ec_point_y, scratch); in _nx_crypto_ec_fp_projective_multiple()
2898 naf_data = scratch; in _nx_crypto_ec_fp_projective_multiple()
2900 scratch += naf_size; in _nx_crypto_ec_fp_projective_multiple()
2920 _nx_crypto_ec_fp_projective_double(curve, &projective_point, scratch); in _nx_crypto_ec_fp_projective_multiple()
2926 _nx_crypto_ec_fp_projective_add(curve, &projective_point, g, scratch); in _nx_crypto_ec_fp_projective_multiple()
2930 _nx_crypto_ec_fp_projective_add(curve, &projective_point, &negative_g, scratch); in _nx_crypto_ec_fp_projective_multiple()
2936 _nx_crypto_ec_point_fp_projective_to_affine(curve, &projective_point, scratch); in _nx_crypto_ec_fp_projective_multiple()
3002 HN_UBASE *scratch) in _nx_crypto_ec_fp_fixed_multiple() argument
3023 NX_CRYPTO_EC_POINT_INITIALIZE(&projective_point, NX_CRYPTO_EC_POINT_PROJECTIVE, scratch, in _nx_crypto_ec_fp_fixed_multiple()
3025 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&expanded_d, scratch, expanded_size); in _nx_crypto_ec_fp_fixed_multiple()
3035 _nx_crypto_ec_fp_projective_double(curve, &projective_point, scratch); in _nx_crypto_ec_fp_fixed_multiple()
3049 _nx_crypto_ec_fp_projective_add(curve, &projective_point, g, scratch); in _nx_crypto_ec_fp_fixed_multiple()
3055 scratch); in _nx_crypto_ec_fp_fixed_multiple()
3076 scratch); in _nx_crypto_ec_fp_fixed_multiple()
3080 _nx_crypto_ec_point_fp_projective_to_affine(curve, &projective_point, scratch); in _nx_crypto_ec_fp_fixed_multiple()
3150 HN_UBASE *scratch) in _nx_crypto_ec_key_pair_generation_extra() argument
3158 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&random_number, scratch, buffer_size); in _nx_crypto_ec_key_pair_generation_extra()
3159 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&modulus, scratch, buffer_size); in _nx_crypto_ec_key_pair_generation_extra()
3162 status = NX_CRYPTO_RBG(bits, (UCHAR *)scratch); in _nx_crypto_ec_key_pair_generation_extra()
3169 status = _nx_crypto_huge_number_setup(&random_number, (const UCHAR *)scratch, buffer_size); in _nx_crypto_ec_key_pair_generation_extra()
3186 curve -> nx_crypto_ec_multiple(curve, g, private_key, public_key, scratch); in _nx_crypto_ec_key_pair_generation_extra()
3243 HN_UBASE *scratch) in _nx_crypto_ec_key_pair_stream_generate() argument
3263 NX_CRYPTO_EC_POINT_INITIALIZE(&public_key, NX_CRYPTO_EC_POINT_AFFINE, scratch, in _nx_crypto_ec_key_pair_stream_generate()
3267 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&private_key, scratch, private_key_len); in _nx_crypto_ec_key_pair_stream_generate()
3271 &public_key, scratch); in _nx_crypto_ec_key_pair_stream_generate()
4289 HN_UBASE *scratch) in _nx_crypto_ec_validate_public_key() argument
4295 HN_UBASE *scratch2 = scratch; in _nx_crypto_ec_validate_public_key()
4579 HN_UBASE* scratch) in _nx_crypto_ec_x25519_448_multiple() argument
4598 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&k_2, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4599 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&x_1, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4601 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&x_2, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4602 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&z_2, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4603 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&x_3, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4604 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&z_3, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4605 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&t_1, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4606 NX_CRYPTO_HUGE_NUMBER_INITIALIZE(&t_2, scratch, clen); in _nx_crypto_ec_x25519_448_multiple()
4722 …_nx_crypto_huge_number_inverse_modulus_prime(&z_2, &curve -> nx_crypto_ec_field.fp, &t_1, scratch); in _nx_crypto_ec_x25519_448_multiple()
5012 HN_UBASE *scratch) in _nx_crypto_ec_key_pair_generation_x25519_448() argument
5028 curve -> nx_crypto_ec_multiple(curve, g, private_key, public_key, scratch); in _nx_crypto_ec_key_pair_generation_x25519_448()