Lines Matching refs:TEST_ASSERT

19     TEST_ASSERT( mbedtls_mpi_get_bit( &X, 42 ) == 0 );
20 TEST_ASSERT( mbedtls_mpi_lsb( &X ) == 0 );
21 TEST_ASSERT( mbedtls_mpi_bitlen( &X ) == 0 );
22 TEST_ASSERT( mbedtls_mpi_size( &X ) == 0 );
40 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == result_read );
43TEST_ASSERT( mbedtls_mpi_write_string( &X, radix_A, str, output_size, &len ) == result_write );
46 TEST_ASSERT( strcasecmp( str, input_A ) == 0 );
68 TEST_ASSERT( mbedtls_mpi_read_binary( &X, buf, input_len ) == 0 );
69 TEST_ASSERT( mbedtls_mpi_write_string( &X, radix_A, (char *) str, sizeof( str ), &len ) == 0 );
70 TEST_ASSERT( strcmp( (char *) str, input_A ) == 0 );
91 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
97 TEST_ASSERT( mbedtls_mpi_write_binary( &X, buf, buflen ) == result );
102 TEST_ASSERT( strcasecmp( (char *) str, input_A ) == 0 );
127 TEST_ASSERT( file != NULL );
130 TEST_ASSERT( ret == result );
135 TEST_ASSERT( mbedtls_mpi_write_binary( &X, buf, buflen ) == 0 );
139 TEST_ASSERT( strcasecmp( (char *) str, input_A ) == 0 );
157 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
160 TEST_ASSERT( file_out != NULL );
163 TEST_ASSERT( ret == 0 );
166 TEST_ASSERT( file_in != NULL );
169 TEST_ASSERT( ret == 0 );
171 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) == 0 );
183 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
184 TEST_ASSERT( mbedtls_mpi_get_bit( &X, pos ) == val );
198 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
199 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, output_Y ) == 0 );
200 TEST_ASSERT( mbedtls_mpi_set_bit( &X, pos, val ) == result );
204 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) == 0 );
218 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
219 TEST_ASSERT( mbedtls_mpi_lsb( &X ) == (size_t) nr_bits );
232 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
233 TEST_ASSERT( mbedtls_mpi_bitlen( &X ) == (size_t) nr_bits );
247 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
248 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
249 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
250 TEST_ASSERT( mbedtls_mpi_gcd( &Z, &X, &Y ) == 0 );
251 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
264 TEST_ASSERT( mbedtls_mpi_lset( &X, input_X ) == 0);
265 TEST_ASSERT( mbedtls_mpi_cmp_int( &X, input_A ) == result_CMP);
279 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
280 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
281 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) == input_A );
295 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
296 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
297 TEST_ASSERT( mbedtls_mpi_cmp_abs( &X, &Y ) == input_A );
310 TEST_ASSERT( mbedtls_mpi_lset( &X, input_X ) == 0 );
311 TEST_ASSERT( mbedtls_mpi_lset( &Y, input_A ) == 0 );
312 TEST_ASSERT( mbedtls_mpi_lset( &A, input_A ) == 0 );
313 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) != 0 );
314 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &A ) == 0 );
315 TEST_ASSERT( mbedtls_mpi_copy( &Y, &X ) == 0 );
316 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) == 0 );
317 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &A ) != 0 );
330 TEST_ASSERT( mbedtls_mpi_lset( &X, input_X ) == 0 );
331 TEST_ASSERT( mbedtls_mpi_copy( &X, &X ) == 0 );
332 TEST_ASSERT( mbedtls_mpi_cmp_int( &X, input_X ) == 0 );
345 TEST_ASSERT( mbedtls_mpi_grow( &X, before ) == 0 );
346 TEST_ASSERT( used <= before );
348 TEST_ASSERT( mbedtls_mpi_shrink( &X, min ) == 0 );
349 TEST_ASSERT( X.n == (size_t) after );
363 TEST_ASSERT( mbedtls_mpi_read_string( &X, 16, x_str ) == 0 );
365 TEST_ASSERT( mbedtls_mpi_read_string( &Y, 16, y_str ) == 0 );
367 TEST_ASSERT( mbedtls_mpi_copy( &XX, &X ) == 0 );
369 TEST_ASSERT( mbedtls_mpi_safe_cond_assign( &X, &Y, 0 ) == 0 );
370 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &XX ) == 0 );
372 TEST_ASSERT( mbedtls_mpi_safe_cond_assign( &X, &Y, 1 ) == 0 );
373 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) == 0 );
389 TEST_ASSERT( mbedtls_mpi_read_string( &X, 16, x_str ) == 0 );
391 TEST_ASSERT( mbedtls_mpi_read_string( &Y, 16, y_str ) == 0 );
394 TEST_ASSERT( mbedtls_mpi_copy( &XX, &X ) == 0 );
395 TEST_ASSERT( mbedtls_mpi_copy( &YY, &Y ) == 0 );
397 TEST_ASSERT( mbedtls_mpi_safe_cond_swap( &X, &Y, 0 ) == 0 );
398 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &XX ) == 0 );
399 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &YY ) == 0 );
401 TEST_ASSERT( mbedtls_mpi_safe_cond_swap( &X, &Y, 1 ) == 0 );
402 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &XX ) == 0 );
403 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &YY ) == 0 );
417 TEST_ASSERT( mbedtls_mpi_lset( &X, input_X ) == 0 );
418 TEST_ASSERT( mbedtls_mpi_lset( &Y, input_Y ) == 0 );
419 TEST_ASSERT( mbedtls_mpi_lset( &A, input_X ) == 0 );
420 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) != 0 );
421 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
423 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &Y ) != 0 );
424 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &A ) == 0 );
438 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
439 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
440 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
441 TEST_ASSERT( mbedtls_mpi_add_mpi( &Z, &X, &Y ) == 0 );
442 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
455 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
457 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
458 TEST_ASSERT( mbedtls_mpi_sub_abs( &X, &X, &X ) == 0 );
459 TEST_ASSERT( mbedtls_mpi_cmp_int( &X, 0 ) == 0 );
461 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
462 TEST_ASSERT( mbedtls_mpi_add_abs( &X, &X, &X ) == 0 );
463 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
465 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
466 TEST_ASSERT( mbedtls_mpi_add_mpi( &X, &X, &X ) == 0 );
467 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
482 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
483 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
484 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
485 TEST_ASSERT( mbedtls_mpi_add_abs( &Z, &X, &Y ) == 0 );
486 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
500 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
501 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
502 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
503 TEST_ASSERT( mbedtls_mpi_add_abs( &X, &X, &Y ) == 0 );
504 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
518 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
519 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
520 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
521 TEST_ASSERT( mbedtls_mpi_add_abs( &Y, &X, &Y ) == 0 );
522 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Y, &A ) == 0 );
536 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
537 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
538 TEST_ASSERT( mbedtls_mpi_add_int( &Z, &X, input_Y ) == 0 );
539 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
553 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
554 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
555 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
556 TEST_ASSERT( mbedtls_mpi_sub_mpi( &Z, &X, &Y ) == 0 );
557 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
572 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
573 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
574 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
577 TEST_ASSERT( res == sub_result );
579 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
593 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
594 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
595 TEST_ASSERT( mbedtls_mpi_sub_int( &Z, &X, input_Y ) == 0 );
596 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
610 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
611 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
612 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
613 TEST_ASSERT( mbedtls_mpi_mul_mpi( &Z, &X, &Y ) == 0 );
614 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
628 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
629 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
630 TEST_ASSERT( mbedtls_mpi_mul_int( &Z, &X, input_Y ) == 0 );
632 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
634 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) != 0 );
636 TEST_ASSERT( "unknown operator" == 0 );
653 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
654 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
655 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
656 TEST_ASSERT( mbedtls_mpi_read_string( &B, radix_B, input_B ) == 0 );
658 TEST_ASSERT( res == div_result );
661 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Q, &A ) == 0 );
662 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &R, &B ) == 0 );
680 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
681 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
682 TEST_ASSERT( mbedtls_mpi_read_string( &B, radix_B, input_B ) == 0 );
684 TEST_ASSERT( res == div_result );
687 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Q, &A ) == 0 );
688 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &R, &B ) == 0 );
705 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
706 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
707 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
709 TEST_ASSERT( res == div_result );
712 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
729 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
731 TEST_ASSERT( res == div_result );
734 TEST_ASSERT( r == (mbedtls_mpi_uint) input_A );
752 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
753 TEST_ASSERT( mbedtls_mpi_read_string( &E, radix_E, input_E ) == 0 );
754 TEST_ASSERT( mbedtls_mpi_read_string( &N, radix_N, input_N ) == 0 );
755 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
758 TEST_ASSERT( mbedtls_mpi_read_string( &RR, radix_RR, input_RR ) == 0 );
761 TEST_ASSERT( res == div_result );
764 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &X ) == 0 );
781 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
782 TEST_ASSERT( mbedtls_mpi_read_string( &Y, radix_Y, input_Y ) == 0 );
783 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
785 TEST_ASSERT( res == div_result );
788 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &Z, &A ) == 0 );
803 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
805 TEST_ASSERT( res == div_result );
821 TEST_ASSERT( my_ret == ref_ret );
827 TEST_ASSERT( actual_bits >= (size_t) bits );
828 TEST_ASSERT( actual_bits <= (size_t) bits + 1 );
830 TEST_ASSERT( mbedtls_mpi_is_prime( &X, rnd_std_rand, NULL ) == 0 );
834 TEST_ASSERT( mbedtls_mpi_is_prime( &X, rnd_std_rand, NULL ) == 0 );
850 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
851 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
852 TEST_ASSERT( mbedtls_mpi_shift_l( &X, shift_X ) == 0 );
853 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
867 TEST_ASSERT( mbedtls_mpi_read_string( &X, radix_X, input_X ) == 0 );
868 TEST_ASSERT( mbedtls_mpi_read_string( &A, radix_A, input_A ) == 0 );
869 TEST_ASSERT( mbedtls_mpi_shift_r( &X, shift_X ) == 0 );
870 TEST_ASSERT( mbedtls_mpi_cmp_mpi( &X, &A ) == 0 );
880 TEST_ASSERT( mbedtls_mpi_self_test( 1 ) == 0 );