Home
last modified time | relevance | path

Searched refs:err (Results 1 – 25 of 454) sorted by relevance

12345678910>>...19

/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/
H A Dchacha20poly1305_test.c34 int err; in chacha20poly1305_test()
37 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test()
38 if ((err = chacha20poly1305_setiv(&st1, i12, sizeof(i12))) != CRYPT_OK) return err; in chacha20poly1305_test()
39 if ((err = chacha20poly1305_add_aad(&st1, aad, sizeof(aad))) != CRYPT_OK) return err; in chacha20poly1305_test()
41 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m, 25, ct)) != CRYPT_OK) re… in chacha20poly1305_test()
42 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 25, 10, ct + 25)) != CRYPT_O… in chacha20poly1305_test()
43 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 35, 35, ct + 35)) != CRYPT_O… in chacha20poly1305_test()
44 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 70, 5, ct + 70)) != CRYPT_O… in chacha20poly1305_test()
45 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 75, 5, ct + 75)) != CRYPT_O… in chacha20poly1305_test()
46 …if ((err = chacha20poly1305_encrypt(&st1, (unsigned char *)m + 80, mlen - 80, ct + 80)) != CRYPT_O… in chacha20poly1305_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/chacha/
H A Dchacha_test.c34 int err; in chacha_test()
39 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test()
40 …if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; in chacha_test()
41 …if ((err = chacha_crypt(&st, (unsigned char*)pt, 35, out )) != CRYPT_OK) return err; in chacha_test()
42 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 35, 35, out + 35)) != CRYPT_OK) return err; in chacha_test()
43 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 70, 5, out + 70)) != CRYPT_OK) return err; in chacha_test()
44 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 75, 5, out + 75)) != CRYPT_OK) return err; in chacha_test()
45 …if ((err = chacha_crypt(&st, (unsigned char*)pt + 80, len - 80, out + 80)) != CRYPT_OK) return err; in chacha_test()
49 …if ((err = chacha_setup(&st, k, sizeof(k), 20)) != CRYPT_OK) return err; in chacha_test()
50 …if ((err = chacha_ivctr32(&st, n, sizeof(n), 1)) != CRYPT_OK) return err; in chacha_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_projective_add_point.c26 int err, inf; in ltc_ecc_projective_add_point() local
34 if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, LTC_NULL)) != CRYPT_OK) { in ltc_ecc_projective_add_point()
35 return err; in ltc_ecc_projective_add_point()
38 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point()
41 err = ltc_ecc_copy_point(Q, R); in ltc_ecc_projective_add_point()
45 if ((err = ltc_ecc_is_point_at_infinity(Q, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_add_point()
48 err = ltc_ecc_copy_point(P, R); in ltc_ecc_projective_add_point()
58 if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
61 err = ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_projective_add_point()
66 if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
[all …]
H A Dltc_ecc_projective_dbl_point.c43 int err, inf; in ltc_ecc_projective_dbl_point() local
50 if ((err = mp_init_multi(&t1, &t2, LTC_NULL)) != CRYPT_OK) { in ltc_ecc_projective_dbl_point()
51 return err; in ltc_ecc_projective_dbl_point()
55 if ((err = ltc_ecc_copy_point(P, R)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
58 if ((err = ltc_ecc_is_point_at_infinity(P, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_projective_dbl_point()
61 err = ltc_ecc_set_point_xyz(1, 1, 0, R); in ltc_ecc_projective_dbl_point()
66 if ((err = mp_sqr(R->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
67 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
69 if ((err = mp_mul(R->z, R->y, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
70 if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
[all …]
H A Decc_recover_key.c35 int err; in ecc_recover_key() local
49 …if ((err = mp_init_multi(&r, &s, &v, &w, &t1, &t2, &u1, &u2, &v1, &v2, &e, &x, &y, &a_plus3, LTC_N… in ecc_recover_key()
50 return err; in ecc_recover_key()
57 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_recover_key()
66 err = CRYPT_MEM; in ecc_recover_key()
72 … if ((err = der_decode_sequence_multi_ex(sig, siglen, LTC_DER_SEQ_SEQUENCE | LTC_DER_SEQ_STRICT, in ecc_recover_key()
81 err = CRYPT_INVALID_PACKET; in ecc_recover_key()
84 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, i)) != CRYPT_OK) … in ecc_recover_key()
85 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+i, i)) != CRYPT_OK) … in ecc_recover_key()
91 err = CRYPT_ERROR; goto error; in ecc_recover_key()
[all …]
H A Decc_set_curve.c10 int err; in ecc_set_curve() local
15 if ((err = mp_init_multi(&key->dp.prime, &key->dp.order, &key->dp.A, &key->dp.B, in ecc_set_curve()
19 return err; in ecc_set_curve()
23 if ((err = mp_read_radix(key->dp.prime, cu->prime, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
24 if ((err = mp_read_radix(key->dp.order, cu->order, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
25 if ((err = mp_read_radix(key->dp.A, cu->A, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
26 if ((err = mp_read_radix(key->dp.B, cu->B, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
27 if ((err = mp_read_radix(key->dp.base.x, cu->Gx, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
28 if ((err = mp_read_radix(key->dp.base.y, cu->Gy, 16)) != CRYPT_OK) { goto error; } in ecc_set_curve()
29 if ((err = mp_set(key->dp.base.z, 1)) != CRYPT_OK) { goto error; } in ecc_set_curve()
[all …]
H A Decc_verify_hash.c32 int err; in ecc_verify_hash_ex() local
45 if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &e, &a_plus3, LTC_NULL)) != CRYPT_OK) { in ecc_verify_hash_ex()
46 return err; in ecc_verify_hash_ex()
52 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_verify_hash_ex()
60 err = CRYPT_MEM; in ecc_verify_hash_ex()
66 … if ((err = der_decode_sequence_multi_ex(sig, siglen, LTC_DER_SEQ_SEQUENCE | LTC_DER_SEQ_STRICT, in ecc_verify_hash_ex()
75 err = CRYPT_INVALID_PACKET; in ecc_verify_hash_ex()
78 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, i)) != CRYPT_OK) … in ecc_verify_hash_ex()
79 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+i, i)) != CRYPT_OK) … in ecc_verify_hash_ex()
85 err = CRYPT_ERROR; goto error; in ecc_verify_hash_ex()
[all …]
H A Decc_make_key.c23 int err; in ecc_make_key() local
25 if ((err = ecc_set_curve_by_size(keysize, key)) != CRYPT_OK) { return err; } in ecc_make_key()
26 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key()
32 int err; in ecc_make_key_ex() local
33 if ((err = ecc_set_curve(cu, key)) != CRYPT_OK) { return err; } in ecc_make_key_ex()
34 if ((err = ecc_generate_key(prng, wprng, key)) != CRYPT_OK) { return err; } in ecc_make_key_ex()
40 int err; in ecc_generate_key() local
53 if ((err = rand_bn_upto(key->k, key->dp.order, prng, wprng)) != CRYPT_OK) { in ecc_generate_key()
58 …if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, key->dp.A, key->dp.prime, 1)) != … in ecc_generate_key()
64 err = CRYPT_OK; in ecc_generate_key()
[all …]
H A Dltc_ecc_map.c23 int err; in ltc_ecc_map() local
33 if ((err = mp_init_multi(&t1, &t2, LTC_NULL)) != CRYPT_OK) { in ltc_ecc_map()
34 return err; in ltc_ecc_map()
38 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
41 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
44 if ((err = mp_sqr(t1, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
45 if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
46 if ((err = mp_mul(t1, t2, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
47 if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
50 if ((err = mp_mul(P->x, t2, P->x)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/sosemanuk/
H A Dsosemanuk_test.c13 int err; in sosemanuk_test()
27 …if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return in sosemanuk_test()
28 …if ((err = sosemanuk_setiv(&st, n, sizeof(n))) != CRYPT_OK) return in sosemanuk_test()
29 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt, 5, out)) != CRYPT_OK) return in sosemanuk_test()
30 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 5, 25, out + 5)) != CRYPT_OK) return in sosemanuk_test()
31 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 30, 10, out + 30)) != CRYPT_OK) return in sosemanuk_test()
32 …if ((err = sosemanuk_crypt(&st, (unsigned char*)pt + 40, len - 40, out + 40)) != CRYPT_OK) return in sosemanuk_test()
36 if ((err = sosemanuk_setup(&st, k, sizeof(k))) != CRYPT_OK) return err; in sosemanuk_test()
37 if ((err = sosemanuk_setiv(&st, n, sizeof(n))) != CRYPT_OK) return err; in sosemanuk_test()
38 if ((err = sosemanuk_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/
H A Dsalsa20_test.c34 int err; in salsa20_test()
40 …if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return er… in salsa20_test()
41 …if ((err = salsa20_ivctr64(&st, n, sizeof(n), counter)) != CRYPT_OK) return er… in salsa20_test()
42 …if ((err = salsa20_crypt(&st, (unsigned char*)pt, 5, out)) != CRYPT_OK) return er… in salsa20_test()
43 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 5, 25, out + 5)) != CRYPT_OK) return er… in salsa20_test()
44 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 30, 10, out + 30)) != CRYPT_OK) return er… in salsa20_test()
45 …if ((err = salsa20_crypt(&st, (unsigned char*)pt + 40, len - 40, out + 40)) != CRYPT_OK) return er… in salsa20_test()
51 if ((err = salsa20_setup(&st, k, sizeof(k), rounds)) != CRYPT_OK) return err; in salsa20_test()
52 if ((err = salsa20_ivctr64(&st, n, sizeof(n), counter)) != CRYPT_OK) return err; in salsa20_test()
53 if ((err = salsa20_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test()
[all …]
H A Dxsalsa20_test.c43 int err; in xsalsa20_test()
45 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test()
46 if ((err = salsa20_crypt(&st, msg, msglen, ciphertext)) != CRYPT_OK) return err; in xsalsa20_test()
47 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test()
49 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test()
50 if ((err = salsa20_crypt(&st, ciphertext, msglen, msg2)) != CRYPT_OK) return err; in xsalsa20_test()
51 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test()
57 …if ((err = xsalsa20_memory(key, sizeof(key), 20, nonce, sizeof(nonce), msg, msglen, ciphertext)) … in xsalsa20_test()
58 …if ((err = xsalsa20_memory(key, sizeof(key), 20, nonce, sizeof(nonce), ciphertext, msglen, msg2)) … in xsalsa20_test()
75 int err; in xsalsa20_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/rsa/
H A Drsa_make_key.c15 int err; in s_rsa_make_key() local
21 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in s_rsa_make_key()
22 return err; in s_rsa_make_key()
25 if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, LTC_NULL)) != CRYPT_OK) { in s_rsa_make_key()
26 return err; in s_rsa_make_key()
33 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key()
34 … if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto cleanup; } /* tmp1 = p-1 */ in s_rsa_make_key()
35 …if ((err = mp_gcd( tmp1, e, tmp2)) != CRYPT_OK) { goto cleanup; } /* tmp2 = gcd(p-1… in s_rsa_make_key()
40 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key()
41 … if ((err = mp_sub_d( q, 1, tmp1)) != CRYPT_OK) { goto cleanup; } /* tmp1 = q-1 */ in s_rsa_make_key()
[all …]
H A Drsa_exptmod.c32 int err, has_crt_parameters; in rsa_exptmod() local
50 if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, in rsa_exptmod()
55 { return err; } in rsa_exptmod()
56 if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) in rsa_exptmod()
62 err = CRYPT_PK_INVALID_SIZE; in rsa_exptmod()
70 err = mp_rand(rnd, mp_get_digit_count(key->N)); in rsa_exptmod()
71 if (err != CRYPT_OK) { in rsa_exptmod()
76 err = mp_invmod(rnd, key->N, rndi); in rsa_exptmod()
77 if (err != CRYPT_OK) { in rsa_exptmod()
82 err = mp_exptmod( rnd, key->e, key->N, rnd); in rsa_exptmod()
[all …]
/optee_os/core/lib/libtomcrypt/src/mac/poly1305/
H A Dpoly1305_test.c25 int err; in poly1305_test()
28 if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; in poly1305_test()
29 if ((err = poly1305_process(&st, (unsigned char*)m, 5)) != CRYPT_OK) return err; in poly1305_test()
30 if ((err = poly1305_process(&st, (unsigned char*)m + 5, 4)) != CRYPT_OK) return err; in poly1305_test()
31 if ((err = poly1305_process(&st, (unsigned char*)m + 9, 3)) != CRYPT_OK) return err; in poly1305_test()
32 if ((err = poly1305_process(&st, (unsigned char*)m + 12, 2)) != CRYPT_OK) return err; in poly1305_test()
33 if ((err = poly1305_process(&st, (unsigned char*)m + 14, 1)) != CRYPT_OK) return err; in poly1305_test()
34 if ((err = poly1305_process(&st, (unsigned char*)m + 15, mlen - 15)) != CRYPT_OK) return err; in poly1305_test()
35 if ((err = poly1305_done(&st, out, &len)) != CRYPT_OK) return err; in poly1305_test()
38 if ((err = poly1305_init(&st, k, 32)) != CRYPT_OK) return err; in poly1305_test()
[all …]
/optee_os/core/lib/libfdt/
H A Dfdt_empty_tree.c15 int err; in fdt_create_empty_tree() local
17 err = fdt_create(buf, bufsize); in fdt_create_empty_tree()
18 if (err) in fdt_create_empty_tree()
19 return err; in fdt_create_empty_tree()
21 err = fdt_finish_reservemap(buf); in fdt_create_empty_tree()
22 if (err) in fdt_create_empty_tree()
23 return err; in fdt_create_empty_tree()
25 err = fdt_begin_node(buf, ""); in fdt_create_empty_tree()
26 if (err) in fdt_create_empty_tree()
27 return err; in fdt_create_empty_tree()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/dsa/
H A Ddsa_verify_key.c25 int err; in dsa_verify_key() local
27 err = dsa_int_validate_primes(key, stat); in dsa_verify_key()
28 if (err != CRYPT_OK || *stat == 0) return err; in dsa_verify_key()
30 err = dsa_int_validate_pqg(key, stat); in dsa_verify_key()
31 if (err != CRYPT_OK || *stat == 0) return err; in dsa_verify_key()
47 int err; in dsa_int_validate_pqg() local
65 if ((err = mp_init_multi(&tmp1, &tmp2, LTC_NULL)) != CRYPT_OK) { return err; } in dsa_int_validate_pqg()
68 if ((err = mp_sub_d(key->p, 1, tmp1)) != CRYPT_OK) { goto error; } in dsa_int_validate_pqg()
69 if ((err = mp_div(tmp1, key->q, tmp1, tmp2)) != CRYPT_OK) { goto error; } in dsa_int_validate_pqg()
71 err = CRYPT_OK; in dsa_int_validate_pqg()
[all …]
H A Ddsa_generate_pqg.c26 int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash; in s_dsa_make_params() local
103 if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } in s_dsa_make_params()
108 …if ((wbuf = XMALLOC((n+1)*outbytes)) == NULL) { err = CRYPT_MEM; … in s_dsa_make_params()
109 …if ((sbuf = XMALLOC(seedbytes)) == NULL) { err = CRYPT_MEM; … in s_dsa_make_params()
111 err = mp_init_multi(&t2L1, &t2N1, &t2q, &t2seedlen, &U, &W, &X, &c, &h, &e, &seedinc, LTC_NULL); in s_dsa_make_params()
112 if (err != CRYPT_OK) { goto cleanup1; } in s_dsa_make_params()
114 if ((err = mp_2expt(t2L1, L-1)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params()
116 if ((err = mp_2expt(t2N1, N-1)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params()
118 if ((err = mp_2expt(t2seedlen, seedbytes*8)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params()
124 …if (prng_descriptor[wprng]->read(sbuf, seedbytes, prng) != seedbytes) { err = CRYPT_ERROR_RE… in s_dsa_make_params()
[all …]
H A Ddsa_verify_hash.c28 int err; in dsa_verify_hash_raw() local
39 if ((err = mp_init_multi(&w, &v, &u1, &u2, LTC_NULL)) != CRYPT_OK) { in dsa_verify_hash_raw()
40 return err; in dsa_verify_hash_raw()
45 err = CRYPT_INVALID_PACKET; in dsa_verify_hash_raw()
53 …if ((err = mp_invmod(s, key->q, w)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
56 …if ((err = mp_read_unsigned_bin(u1, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
57 …if ((err = mp_mulmod(u1, w, key->q, u1)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
60 …if ((err = mp_mulmod(r, w, key->q, u2)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
63 …if ((err = mp_exptmod(key->g, u1, key->p, u1)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
64 …if ((err = mp_exptmod(key->y, u2, key->p, u2)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
[all …]
/optee_os/core/lib/libtomcrypt/src/prngs/
H A Dchacha20.c52 int err; in chacha20_prng_add_entropy() local
61 … if ((err = chacha_keystream(&prng->u.chacha.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in chacha20_prng_add_entropy()
64 if ((err = chacha_setup(&prng->u.chacha.s, buf, 32, 20)) != CRYPT_OK) goto LBL_UNLOCK; in chacha20_prng_add_entropy()
66 if ((err = chacha_ivctr64(&prng->u.chacha.s, buf + 32, 8, 0)) != CRYPT_OK) goto LBL_UNLOCK; in chacha20_prng_add_entropy()
74 err = CRYPT_OK; in chacha20_prng_add_entropy()
77 return err; in chacha20_prng_add_entropy()
87 int err; in chacha20_prng_ready() local
92 …if (prng->ready) { err = CRYPT_OK; goto LBL_UNL… in chacha20_prng_ready()
94 …if ((err = chacha_setup(&prng->u.chacha.s, prng->u.chacha.ent, 32, 20)) != CRYPT_OK) goto LBL… in chacha20_prng_ready()
96 …if ((err = chacha_ivctr64(&prng->u.chacha.s, prng->u.chacha.ent + 32, 8, 0)) != CRYPT_OK) goto LBL… in chacha20_prng_ready()
[all …]
H A Dsober128.c54 int err; in sober128_add_entropy() local
63 …if ((err = sober128_stream_keystream(&prng->u.sober128.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL… in sober128_add_entropy()
66 … if ((err = sober128_stream_setup(&prng->u.sober128.s, buf, 32)) != CRYPT_OK) goto LBL_UNLOCK; in sober128_add_entropy()
68 … if ((err = sober128_stream_setiv(&prng->u.sober128.s, buf + 32, 8)) != CRYPT_OK) goto LBL_UNLOCK; in sober128_add_entropy()
76 err = CRYPT_OK; in sober128_add_entropy()
79 return err; in sober128_add_entropy()
89 int err; in sober128_ready() local
94 …if (prng->ready) { err = CRYPT_OK; goto… in sober128_ready()
96 …if ((err = sober128_stream_setup(&prng->u.sober128.s, prng->u.sober128.ent, 32)) != CRYPT_OK) … in sober128_ready()
98 …if ((err = sober128_stream_setiv(&prng->u.sober128.s, prng->u.sober128.ent + 32, 8)) != CRYPT_OK) … in sober128_ready()
[all …]
H A Drc4.c54 int err; in rc4_add_entropy() local
63 … if ((err = rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in rc4_add_entropy()
66 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in rc4_add_entropy()
75 err = CRYPT_OK; in rc4_add_entropy()
78 return err; in rc4_add_entropy()
90 int err, i; in rc4_ready() local
95 if (prng->ready) { err = CRYPT_OK; goto LBL_UNLOCK; } in rc4_ready()
99 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; in rc4_ready()
105 return err; in rc4_ready()
133 int err; in rc4_done() local
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/
H A Dder_decode_sequence_flexi.c42 unsigned long err, identifier, len, totlen, data_offset, id_len, len_len; in s_der_decode_sequence_flexi() local
54 if ((err = s_new_element(&l)) != CRYPT_OK) { in s_der_decode_sequence_flexi()
62 if ((err = s_new_element(&l)) != CRYPT_OK) { in s_der_decode_sequence_flexi()
67 if ((err = der_decode_asn1_identifier(in, &id_len, l)) != CRYPT_OK) { in s_der_decode_sequence_flexi()
80 if ((err = der_decode_asn1_length(&in[id_len], &len_len, &len)) != CRYPT_OK) { in s_der_decode_sequence_flexi()
82 …s (%s)\n", identifier, data_offset, len, der_asn1_tag_to_string_map[l->tag], error_to_string(err)); in s_der_decode_sequence_flexi()
86 err = CRYPT_INVALID_PACKET; in s_der_decode_sequence_flexi()
88 …s (%s)\n", identifier, data_offset, len, der_asn1_tag_to_string_map[l->tag], error_to_string(err)); in s_der_decode_sequence_flexi()
127 err = CRYPT_PK_ASN1_ERROR; in s_der_decode_sequence_flexi()
135 if ((err = der_decode_boolean(in, *inlen, l->data)) != CRYPT_OK) { in s_der_decode_sequence_flexi()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/
H A Dder_decode_custom_type.c47 int err, seq_err, i, ordered; in der_decode_custom_type_ex() local
86 if ((err = der_decode_asn1_identifier(in, &y, &ident)) != CRYPT_OK) { in der_decode_custom_type_ex()
93 err = CRYPT_INVALID_PACKET; in der_decode_custom_type_ex()
105 err = CRYPT_INVALID_PACKET; in der_decode_custom_type_ex()
119 if ((err = der_decode_asn1_length(&in[x], &y, &blksize)) != CRYPT_OK) { in der_decode_custom_type_ex()
127 err = CRYPT_INVALID_PACKET; in der_decode_custom_type_ex()
153 err = CRYPT_PK_ASN1_ERROR; in der_decode_custom_type_ex()
167 err = CRYPT_PK_ASN1_ERROR; in der_decode_custom_type_ex()
176 if ((err = der_decode_boolean(in + x, z, ((int *)data))) != CRYPT_OK) { in der_decode_custom_type_ex()
180 if ((err = der_length_boolean(&z)) != CRYPT_OK) { in der_decode_custom_type_ex()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
H A Docb3_test.c199 int err, x, idx, res; in ocb3_test()
214 if ((err = ocb3_encrypt_authenticate_memory(idx, in ocb3_test()
220 return err; in ocb3_test()
228 if ((err = ocb3_decrypt_verify_memory(idx, in ocb3_test()
234 return err; in ocb3_test()
247 if ((err = ocb3_encrypt_authenticate_memory(idx, in ocb3_test()
253 return err; in ocb3_test()
261 if ((err = ocb3_decrypt_verify_memory(idx, in ocb3_test()
267 return err; in ocb3_test()
278 if ((err = ocb3_init(&ocb, idx, K, sizeof(K), N, sizeof(N), 12)) != CRYPT_OK) return err; in ocb3_test()
[all …]

12345678910>>...19