/optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_projective_add_point.c | 41 if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) { in ltc_ecc_projective_add_point() 45 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point() 52 if ((err = ltc_ecc_is_point_at_infinity(Q, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point() 65 if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 73 if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 74 if ((err = mp_copy(P->y, y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 75 if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 80 if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 81 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 83 if ((err = mp_mul(t1, x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
A D | ltc_ecc_projective_dbl_point.c | 57 if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { in ltc_ecc_projective_dbl_point() 62 if ((err = ltc_ecc_copy_point(P, R)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 65 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_dbl_point() 73 if ((err = mp_sqr(R->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 74 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 76 if ((err = mp_mul(R->z, R->y, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 77 if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 79 if ((err = mp_add(R->z, R->z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 81 if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 86 if ((err = mp_sub(R->x, t1, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() [all …]
|
A D | ecc_recover_key.c | 56 …nit_multi(&r, &s, &v, &w, &t1, &t2, &u1, &u2, &v1, &v2, &e, &x, &y, &a_plus3, NULL)) != CRYPT_OK) { in ecc_recover_key() 64 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_recover_key() 82 … LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto error; } in ecc_recover_key() 91 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, i)) != CRYPT_OK) … in ecc_recover_key() 92 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+i, i)) != CRYPT_OK) … in ecc_recover_key() 96 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_recover_key() 112 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, 32)) != CRYPT_OK) … in ecc_recover_key() 113 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+32, 32)) != CRYPT_OK) … in ecc_recover_key() 125 … LTC_SSHDATA_EOL, NULL)) != CRYPT_OK) { goto error; } in ecc_recover_key() 159 …if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, hashlen)) != CRYPT_OK) … in ecc_recover_key() [all …]
|
A D | ecc_verify_hash.c | 52 if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &e, &a_plus3, NULL)) != CRYPT_OK) { in ecc_verify_hash_ex() 59 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_verify_hash_ex() 76 … LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { goto error; } in ecc_verify_hash_ex() 85 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, i)) != CRYPT_OK) … in ecc_verify_hash_ex() 86 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+i, i)) != CRYPT_OK) … in ecc_verify_hash_ex() 90 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_verify_hash_ex() 98 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, 32)) != CRYPT_OK) … in ecc_verify_hash_ex() 99 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+32, 32)) != CRYPT_OK) … in ecc_verify_hash_ex() 111 … LTC_SSHDATA_EOL, NULL)) != CRYPT_OK) { goto error; } in ecc_verify_hash_ex() 139 …if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, hashlen)) != CRYPT_OK) … in ecc_verify_hash_ex() [all …]
|
A D | ltc_ecc_mulmod_timing.c | 45 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 52 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 53 if ((err = mp_init(&mu)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 54 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 57 if ((err = mp_init(&a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 58 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 60 if ((err = mp_init(&ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 61 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 82 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 83 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ecc_sign_hash.c | 56 if ((err = mp_init_multi(&r, &s, &e, &b, NULL)) != CRYPT_OK) { in ecc_sign_hash_ex() 82 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 83 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 86 if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 91 if (mp_copy(pubkey.pubkey.x, s) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 95 if ((err = mp_sub(s, p, s)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 141 err = CRYPT_OK; in ecc_sign_hash_ex() 145 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_sign_hash_ex() 152 if ((err = mp_to_unsigned_bin(r, out + 32 - i)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 154 if ((err = mp_to_unsigned_bin(s, out + 64 - i)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() [all …]
|
A D | ltc_ecc_mulmod.c | 46 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 53 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 54 if ((err = mp_init(&mu)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 55 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 58 if ((err = mp_init(&a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 59 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 61 if ((err = mp_init(&ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 62 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 83 if ((err = ltc_ecc_copy_point(G, tG)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 85 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ltc_ecc_map.c | 40 if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { in ltc_ecc_map() 45 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 48 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 51 if ((err = mp_sqr(t1, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 52 if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 53 if ((err = mp_mul(t1, t2, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 54 if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 57 if ((err = mp_mul(P->x, t2, P->x)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 58 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 59 if ((err = mp_mul(P->y, t1, P->y)) != CRYPT_OK) { goto done; } in ltc_ecc_map() [all …]
|
A D | ltc_ecc_import_point.c | 22 if (mp_init_multi(&t1, &t2, NULL) != CRYPT_OK) { in ltc_ecc_import_point() 31 …if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 33 …if ((err = mp_read_unsigned_bin(y, (unsigned char *)in+1+size, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 38 …if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 40 …if ((err = mp_sqr(x, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 41 …if ((err = mp_mulmod(t1, x, prime, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 43 …if ((err = mp_mulmod(a, x, prime, t2)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 44 …if ((err = mp_add(t1, t2, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 46 …if ((err = mp_add(t1, b, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 48 …if ((err = mp_sqrtmod_prime(t1, prime, t2)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/ |
A D | der_decode_choice.c | 58 return CRYPT_OK; in der_decode_choice() 68 return CRYPT_OK; in der_decode_choice() 78 return CRYPT_OK; in der_decode_choice() 89 return CRYPT_OK; in der_decode_choice() 100 return CRYPT_OK; in der_decode_choice() 111 return CRYPT_OK; in der_decode_choice() 120 return CRYPT_OK; in der_decode_choice() 130 return CRYPT_OK; in der_decode_choice() 141 return CRYPT_OK; in der_decode_choice() 184 return CRYPT_OK; in der_decode_choice() [all …]
|
/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_test.c | 44 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test() 55 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 67 if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 92 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 103 if ((err = chacha20poly1305_done(&st1, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 114 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 122 if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 144 if (err != CRYPT_OK) return CRYPT_FAIL_TESTVECTOR; in chacha20poly1305_test() 151 if (err != CRYPT_OK) return CRYPT_FAIL_TESTVECTOR; in chacha20poly1305_test() 157 if (err == CRYPT_OK) { in chacha20poly1305_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/dsa/ |
A D | dsa_verify_key.c | 64 return CRYPT_OK; in dsa_int_validate_pqg() 69 return CRYPT_OK; in dsa_int_validate_pqg() 78 err = CRYPT_OK; in dsa_int_validate_pqg() 87 err = CRYPT_OK; in dsa_int_validate_pqg() 91 err = CRYPT_OK; in dsa_int_validate_pqg() 118 return CRYPT_OK; in dsa_int_validate_primes() 126 return CRYPT_OK; in dsa_int_validate_primes() 130 return CRYPT_OK; in dsa_int_validate_primes() 157 err = CRYPT_OK; in dsa_int_validate_xy() 164 err = CRYPT_OK; in dsa_int_validate_xy() [all …]
|
A D | dsa_generate_pqg.c | 110 if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } in _dsa_make_params() 121 if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 123 if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 125 if ((err = mp_2expt(t2seedlen, seedbytes*8)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 133 if ((err = hash_memory(hash, sbuf, seedbytes, digest, &i)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 134 if ((err = mp_read_unsigned_bin(U, digest, outbytes)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 135 if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } in _dsa_make_params() 195 err = CRYPT_OK; in _dsa_make_params() 223 if ((err = mp_init_multi(&key->p, &key->g, &key->q, &key->x, &key->y, NULL)) != CRYPT_OK) { in dsa_generate_pqg() 228 if (err != CRYPT_OK) { in dsa_generate_pqg() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/rsa/ |
A D | rsa_make_key.c | 28 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in s_rsa_make_key() 32 if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, NULL)) != CRYPT_OK) { in s_rsa_make_key() 40 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key() 47 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key() 74 if ((err = mp_copy( p, key->p)) != CRYPT_OK) { goto errkey; } in s_rsa_make_key() 75 if ((err = mp_copy( q, key->q)) != CRYPT_OK) { goto errkey; } in s_rsa_make_key() 81 err = CRYPT_OK; in s_rsa_make_key() 108 if ((err = mp_init(&tmp_e)) != CRYPT_OK) { in rsa_make_key() 112 if ((err = mp_set_int(tmp_e, e)) == CRYPT_OK) in rsa_make_key() 136 if ((err = mp_init(&tmp_e)) != CRYPT_OK) { in rsa_make_key_ubin_e() [all …]
|
A D | rsa_exptmod.c | 61 NULL)) != CRYPT_OK) in rsa_exptmod() 63 if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) in rsa_exptmod() 78 if (err != CRYPT_OK) { in rsa_exptmod() 84 if (err != CRYPT_OK) { in rsa_exptmod() 90 if (err != CRYPT_OK) { in rsa_exptmod() 96 if (err != CRYPT_OK) { in rsa_exptmod() 112 …if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto … in rsa_exptmod() 115 …if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto … in rsa_exptmod() 132 if (err != CRYPT_OK) { in rsa_exptmod() 146 …if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { got… in rsa_exptmod() [all …]
|
/optee_os/core/lib/libtomcrypt/src/stream/chacha/ |
A D | chacha_test.c | 46 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test() 47 …if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; in chacha_test() 48 …if ((err = chacha_crypt(&st, (unsigned char*)pt, 35, out )) != CRYPT_OK) return err; in chacha_test() 49 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35)) != CRYPT_OK) return err; in chacha_test() 50 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70)) != CRYPT_OK) return err; in chacha_test() 51 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75)) != CRYPT_OK) return err; in chacha_test() 52 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80)) != CRYPT_OK) return err; in chacha_test() 56 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test() 57 …if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; in chacha_test() 58 …if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in chacha_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/ |
A D | der_decode_custom_type.c | 93 if ((err = der_decode_asn1_identifier(in, &y, &ident)) != CRYPT_OK) { in der_decode_custom_type_ex() 145 seq_err = CRYPT_OK; in der_decode_custom_type_ex() 171 if ((err = der_length_boolean(&z)) != CRYPT_OK) { in der_decode_custom_type_ex() 182 if ((err = der_length_integer(data, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 343 err = CRYPT_OK; in der_decode_custom_type_ex() 345 if (err != CRYPT_OK) { in der_decode_custom_type_ex() 359 err = CRYPT_OK; in der_decode_custom_type_ex() 361 if (err != CRYPT_OK) { in der_decode_custom_type_ex() 399 if (blksize == x && seq_err == CRYPT_OK && inlen == 0) { in der_decode_custom_type_ex() 401 err = CRYPT_OK; in der_decode_custom_type_ex() [all …]
|
A D | der_encode_custom_type.c | 46 if ((err = der_length_custom_type(root, &y, &z)) != CRYPT_OK) return CRYPT_INVALID_ARG; in der_encode_custom_type() 73 if ((err = der_encode_asn1_length(z, &out[x], &y)) != CRYPT_OK) { in der_encode_custom_type() 97 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 104 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 118 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 173 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 180 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 187 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 194 if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 226 if ((err = der_encode_asn1_identifier(root, out, &id_len)) != CRYPT_OK) { in der_encode_custom_type() [all …]
|
/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/ |
A D | sosemanuk_test.c | 34 …if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return … in sosemanuk_test() 35 …if ((err = sosemanuk_setiv(&st, n, sizeof(n))) != CRYPT_OK) return … in sosemanuk_test() 43 if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return err; in sosemanuk_test() 44 if ((err = sosemanuk_setiv(&st, n, sizeof(n))) != CRYPT_OK) return err; in sosemanuk_test() 45 if ((err = sosemanuk_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test() 50 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test() 75 if ((err = sosemanuk_setup(&st, k3, sizeof(k3))) != CRYPT_OK) return err; in sosemanuk_test() 76 if ((err = sosemanuk_setiv(&st, n3, sizeof(n3))) != CRYPT_OK) return err; in sosemanuk_test() 77 if ((err = sosemanuk_keystream(&st, out, 64)) != CRYPT_OK) return err; in sosemanuk_test() 78 if ((err = sosemanuk_done(&st)) != CRYPT_OK) return err; in sosemanuk_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/ |
A D | salsa20_test.c | 47 …if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return er… in salsa20_test() 48 …if ((err = salsa20_ivctr64(&st, n, sizeof(n), counter)) != CRYPT_OK) return er… in salsa20_test() 58 if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return err; in salsa20_test() 59 if ((err = salsa20_ivctr64(&st, n, sizeof(n), counter)) != CRYPT_OK) return err; in salsa20_test() 60 if ((err = salsa20_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test() 65 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test() 82 if ((err = salsa20_setup(&st, k3, sizeof(k3), rounds3)) != CRYPT_OK) return err; in salsa20_test() 83 if ((err = salsa20_ivctr64(&st, n3, sizeof(n3), counter3)) != CRYPT_OK) return err; in salsa20_test() 84 if ((err = salsa20_keystream(&st, out, 64)) != CRYPT_OK) return err; in salsa20_test() 85 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in salsa20_test() [all …]
|
A D | xsalsa20_test.c | 28 return CRYPT_OK; in _sha256() 52 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test() 53 if ((err = salsa20_crypt(&st, msg, msglen, ciphertext)) != CRYPT_OK) return err; in xsalsa20_test() 54 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test() 56 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test() 57 if ((err = salsa20_crypt(&st, ciphertext, msglen, msg2)) != CRYPT_OK) return err; in xsalsa20_test() 58 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test() 84 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test() 85 if ((err = salsa20_keystream(&st, keystream, keystreamlen)) != CRYPT_OK) return err; in xsalsa20_test() 86 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/prngs/ |
A D | sober128.c | 47 return CRYPT_OK; in sober128_start() 83 err = CRYPT_OK; in sober128_add_entropy() 173 if ((err = sober128_start(prng)) != CRYPT_OK) return err; in _LTC_PRNG_EXPORT() 174 if ((err = sober128_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; in _LTC_PRNG_EXPORT() 175 return CRYPT_OK; in _LTC_PRNG_EXPORT() 201 if ((err = sober128_start(&st)) != CRYPT_OK) return err; in sober128_test() 203 if ((err = sober128_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; in sober128_test() 204 if ((err = sober128_ready(&st)) != CRYPT_OK) return err; in sober128_test() 209 if ((err = sober128_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; in sober128_test() 211 if ((err = sober128_export(dmp, &dmplen, &st)) != CRYPT_OK) return err; in sober128_test() [all …]
|
A D | chacha20.c | 45 return CRYPT_OK; in chacha20_prng_start() 81 err = CRYPT_OK; in chacha20_prng_add_entropy() 124 if (chacha_keystream(&prng->u.chacha.s, out, outlen) != CRYPT_OK) outlen = 0; in chacha20_prng_read() 171 if ((err = chacha20_prng_start(prng)) != CRYPT_OK) return err; in _LTC_PRNG_EXPORT() 172 if ((err = chacha20_prng_add_entropy(in, inlen, prng)) != CRYPT_OK) return err; in _LTC_PRNG_EXPORT() 173 return CRYPT_OK; in _LTC_PRNG_EXPORT() 199 if ((err = chacha20_prng_start(&st)) != CRYPT_OK) return err; in chacha20_prng_test() 201 if ((err = chacha20_prng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; in chacha20_prng_test() 202 if ((err = chacha20_prng_ready(&st)) != CRYPT_OK) return err; in chacha20_prng_test() 207 if ((err = chacha20_prng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; in chacha20_prng_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/mac/poly1305/ |
A D | poly1305_test.c | 35 if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; in poly1305_test() 36 if ((err = poly1305_process(&st, (unsigned char*)m, 5)) != CRYPT_OK) return err; in poly1305_test() 37 if ((err = poly1305_process(&st, (unsigned char*)m + 5, 4)) != CRYPT_OK) return err; in poly1305_test() 38 if ((err = poly1305_process(&st, (unsigned char*)m + 9, 3)) != CRYPT_OK) return err; in poly1305_test() 39 if ((err = poly1305_process(&st, (unsigned char*)m + 12, 2)) != CRYPT_OK) return err; in poly1305_test() 40 if ((err = poly1305_process(&st, (unsigned char*)m + 14, 1)) != CRYPT_OK) return err; in poly1305_test() 41 if ((err = poly1305_process(&st, (unsigned char*)m + 15, mlen - 15)) != CRYPT_OK) return err; in poly1305_test() 42 if ((err = poly1305_done(&st, out, &len)) != CRYPT_OK) return err; in poly1305_test() 45 if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; in poly1305_test() 46 if ((err = poly1305_process(&st, (unsigned char*)m, mlen)) != CRYPT_OK) return err; in poly1305_test() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
A D | der_encode_sequence_ex.c | 57 if ((err = der_encode_asn1_length(z, &out[x], &y)) != CRYPT_OK) { in der_encode_sequence_ex() 76 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 83 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 97 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 131 if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 152 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 159 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 166 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 173 if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 187 if ((err = der_encode_custom_type(&list[i], out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() [all …]
|