/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_projective_add_point.c | 34 if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, LTC_NULL)) != CRYPT_OK) { 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() 45 if ((err = ltc_ecc_is_point_at_infinity(Q, modulus, &inf)) != CRYPT_OK) return err; 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() 66 if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 67 if ((err = mp_copy(P->y, y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 68 if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 73 if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 74 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 76 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 | 50 if ((err = mp_init_multi(&t1, &t2, LTC_NULL)) != CRYPT_OK) { 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() 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() 72 if ((err = mp_add(R->z, R->z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 74 if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 79 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 | 49 …multi(&r, &s, &v, &w, &t1, &t2, &u1, &u2, &v1, &v2, &e, &x, &y, &a_plus3, LTC_NULL)) != CRYPT_OK) { in ecc_recover_key() 57 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_recover_key() 75 … LTC_ASN1_EOL, 0UL, LTC_NULL)) != CRYPT_OK) { goto error; } 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() 89 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_recover_key() 105 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, 32)) != CRYPT_OK) … in ecc_recover_key() 106 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+32, 32)) != CRYPT_OK) … in ecc_recover_key() 119 … LTC_SSHDATA_EOL, NULL)) != CRYPT_OK) { goto error; } in ecc_recover_key() 123 …if ((err = ecc_ssh_ecdsa_encode_name(name2, &name2len, key)) != CRYPT_OK) … in ecc_recover_key() [all …]
|
A D | ltc_ecc_map.c | 33 if ((err = mp_init_multi(&t1, &t2, LTC_NULL)) != CRYPT_OK) { 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() 51 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 52 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 | 15 if (mp_init_multi(&t1, &t2, LTC_NULL) != CRYPT_OK) { in ltc_ecc_import_point() 24 …if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 26 …if ((err = mp_read_unsigned_bin(y, (unsigned char *)in+1+size, size)) != CRYPT_OK) { goto cleanup;… 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_sqr(x, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 34 …if ((err = mp_mulmod(t1, x, prime, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 36 …if ((err = mp_mulmod(a, x, prime, t2)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 37 …if ((err = mp_add(t1, t2, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 39 …if ((err = mp_add(t1, b, t1)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() 41 …if ((err = mp_sqrtmod_prime(t1, prime, t2)) != CRYPT_OK) { goto cleanup;… in ltc_ecc_import_point() [all …]
|
A D | ltc_ecc_is_point.c | 24 if ((err = mp_init_multi(&t1, &t2, LTC_NULL)) != CRYPT_OK) return err; in ltc_ecc_is_point() 27 if ((err = mp_sqr(y, t1)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 30 if ((err = mp_sqr(x, t2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 31 if ((err = mp_mod(t2, prime, t2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 32 if ((err = mp_mul(x, t2, t2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 35 if ((err = mp_sub(t1, t2, t1)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 38 if ((err = mp_submod(prime, a, prime, t2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 39 if ((err = mp_mulmod(t2, x, prime, t2)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 40 if ((err = mp_addmod(t1, t2, prime, t1)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() 44 if ((err = mp_add(t1, prime, t1)) != CRYPT_OK) goto cleanup; in ltc_ecc_is_point() [all …]
|
A D | ltc_ecc_mulmod_timing.c | 38 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 45 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 46 if ((err = mp_init(&mu)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 47 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 50 if ((err = mp_init(&a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 51 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 53 if ((err = mp_init(&ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 54 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 75 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 76 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
A D | ecc_verify_hash.c | 45 if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &e, &a_plus3, LTC_NULL)) != CRYPT_OK) { in ecc_verify_hash_ex() 52 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { in ecc_verify_hash_ex() 69 … LTC_ASN1_EOL, 0UL, LTC_NULL)) != CRYPT_OK) { goto error; } 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() 83 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_verify_hash_ex() 91 …if ((err = mp_read_unsigned_bin(r, (unsigned char *)sig, 32)) != CRYPT_OK) … in ecc_verify_hash_ex() 92 …if ((err = mp_read_unsigned_bin(s, (unsigned char *)sig+32, 32)) != CRYPT_OK) … in ecc_verify_hash_ex() 105 … LTC_SSHDATA_EOL, NULL)) != CRYPT_OK) { goto error; } in ecc_verify_hash_ex() 109 …if ((err = ecc_ssh_ecdsa_encode_name(name2, &name2len, key)) != CRYPT_OK) … in ecc_verify_hash_ex() [all …]
|
A D | ecc_sign_hash.c | 49 if ((err = mp_init_multi(&r, &s, &e, &b, LTC_NULL)) != CRYPT_OK) { in ecc_sign_hash_ex() 75 if ((err = ecc_copy_curve(key, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 76 if ((err = ecc_generate_key(prng, wprng, &pubkey)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 79 if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 84 if (mp_copy(pubkey.pubkey.x, s) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 88 if ((err = mp_sub(s, p, s)) != CRYPT_OK) { goto error; } in ecc_sign_hash_ex() 134 err = CRYPT_OK; in ecc_sign_hash_ex() 138 if (pk_oid_cmp_with_ulong("1.3.132.0.10", key->dp.oid, key->dp.oidlen) != CRYPT_OK) { in ecc_sign_hash_ex() 145 if ((err = mp_to_unsigned_bin(r, out + 32 - i)) != CRYPT_OK) { goto errnokey; } in ecc_sign_hash_ex() 147 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 | 39 if ((err = ltc_ecc_is_point_at_infinity(G, modulus, &inf)) != CRYPT_OK) return err; in ltc_ecc_mulmod() 46 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 47 if ((err = mp_init(&mu)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 48 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 51 if ((err = mp_init(&a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 52 if ((err = mp_add_d(a, 3, a_plus3)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 54 if ((err = mp_init(&ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 55 if ((err = mp_mulmod(a, mu, modulus, ma)) != CRYPT_OK) { goto error; } in ltc_ecc_mulmod() 76 if ((err = ltc_ecc_copy_point(G, tG)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 78 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/asn1/der/choice/ |
A D | der_decode_choice.c | 51 return CRYPT_OK; in der_decode_choice() 61 return CRYPT_OK; in der_decode_choice() 71 return CRYPT_OK; in der_decode_choice() 82 return CRYPT_OK; in der_decode_choice() 93 return CRYPT_OK; in der_decode_choice() 104 return CRYPT_OK; in der_decode_choice() 113 return CRYPT_OK; in der_decode_choice() 123 return CRYPT_OK; in der_decode_choice() 134 return CRYPT_OK; in der_decode_choice() 177 return CRYPT_OK; in der_decode_choice() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_test.c | 37 if ((err = chacha20poly1305_init(&st1, k, sizeof(k))) != CRYPT_OK) return err; in chacha20poly1305_test() 48 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 60 if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 85 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 96 if ((err = chacha20poly1305_done(&st1, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 107 if ((err = chacha20poly1305_done(&st1, emac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 115 if ((err = chacha20poly1305_done(&st2, dmac, &len)) != CRYPT_OK) return err; in chacha20poly1305_test() 137 if (err != CRYPT_OK) return CRYPT_FAIL_TESTVECTOR; in chacha20poly1305_test() 144 if (err != CRYPT_OK) return CRYPT_FAIL_TESTVECTOR; in chacha20poly1305_test() 150 if (err == CRYPT_OK) { in chacha20poly1305_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/dsa/ |
A D | dsa_verify_key.c | 57 return CRYPT_OK; in dsa_int_validate_pqg() 62 return CRYPT_OK; in dsa_int_validate_pqg() 71 err = CRYPT_OK; in dsa_int_validate_pqg() 80 err = CRYPT_OK; in dsa_int_validate_pqg() 84 err = CRYPT_OK; in dsa_int_validate_pqg() 111 return CRYPT_OK; in dsa_int_validate_primes() 119 return CRYPT_OK; in dsa_int_validate_primes() 123 return CRYPT_OK; in dsa_int_validate_primes() 150 err = CRYPT_OK; in dsa_int_validate_xy() 157 err = CRYPT_OK; in dsa_int_validate_xy() [all …]
|
A D | dsa_generate_pqg.c | 103 if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } 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() 126 if ((err = hash_memory(hash, sbuf, seedbytes, digest, &i)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params() 127 if ((err = mp_read_unsigned_bin(U, digest, outbytes)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params() 128 if ((err = mp_mod(U, t2N1, U)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params() 129 if ((err = mp_add(t2N1, U, q)) != CRYPT_OK) { goto cleanup; } in s_dsa_make_params() 188 err = CRYPT_OK; in s_dsa_make_params() 221 if (err != CRYPT_OK) { in dsa_generate_pqg() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/rsa/ |
A D | rsa_make_key.c | 21 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in s_rsa_make_key() 25 if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, LTC_NULL)) != CRYPT_OK) { in s_rsa_make_key() 33 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key() 40 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto cleanup; } in s_rsa_make_key() 51 if ((err = rsa_init(key)) != CRYPT_OK) { in s_rsa_make_key() 67 if ((err = mp_copy( p, key->p)) != CRYPT_OK) { goto errkey; } in s_rsa_make_key() 74 err = CRYPT_OK; in s_rsa_make_key() 101 if ((err = mp_init(&tmp_e)) != CRYPT_OK) { in rsa_make_key() 105 if ((err = mp_set_int(tmp_e, e)) == CRYPT_OK) in rsa_make_key() 129 if ((err = mp_init(&tmp_e)) != CRYPT_OK) { in rsa_make_key_ubin_e() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/chacha/ |
A D | chacha_test.c | 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() 51 …if ((err = chacha_crypt(&st, (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in chacha_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/poly1305/ |
A D | poly1305_test.c | 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() 39 if ((err = poly1305_process(&st, (unsigned char*)m, mlen)) != CRYPT_OK) return err; in poly1305_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/sosemanuk/ |
A D | sosemanuk_test.c | 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() 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() 43 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in sosemanuk_test() 68 if ((err = sosemanuk_setup(&st, k3, sizeof(k3))) != CRYPT_OK) return err; in sosemanuk_test() 69 if ((err = sosemanuk_setiv(&st, n3, sizeof(n3))) != CRYPT_OK) return err; in sosemanuk_test() 70 if ((err = sosemanuk_keystream(&st, out, 64)) != CRYPT_OK) return err; in sosemanuk_test() 71 if ((err = sosemanuk_done(&st)) != CRYPT_OK) return err; in sosemanuk_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/salsa20/ |
A D | salsa20_test.c | 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() 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() 58 (unsigned char*)pt, len, out)) != CRYPT_OK) return err; in salsa20_test() 75 if ((err = salsa20_setup(&st, k3, sizeof(k3), rounds3)) != CRYPT_OK) return err; in salsa20_test() 76 if ((err = salsa20_ivctr64(&st, n3, sizeof(n3), counter3)) != CRYPT_OK) return err; in salsa20_test() 77 if ((err = salsa20_keystream(&st, out, 64)) != CRYPT_OK) return err; in salsa20_test() 78 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in salsa20_test() [all …]
|
A D | xsalsa20_test.c | 21 return CRYPT_OK; in s_sha256() 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() 77 if ((err = xsalsa20_setup(&st, key, 32, nonce, 24, rounds)) != CRYPT_OK) return err; in xsalsa20_test() 78 if ((err = salsa20_keystream(&st, keystream, keystreamlen)) != CRYPT_OK) return err; in xsalsa20_test() 79 if ((err = salsa20_done(&st)) != CRYPT_OK) return err; in xsalsa20_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/prngs/ |
A D | sprng.c | 38 return CRYPT_OK; in sprng_start() 53 return CRYPT_OK; in sprng_add_entropy() 64 return CRYPT_OK; in sprng_ready() 89 return CRYPT_OK; in sprng_done() 107 return CRYPT_OK; in sprng_export() 122 return CRYPT_OK; in sprng_import() 139 if ((err = sprng_start(&st)) != CRYPT_OK) return err; in sprng_test() 140 if ((err = sprng_add_entropy(en, sizeof(en), &st)) != CRYPT_OK) return err; in sprng_test() 141 if ((err = sprng_ready(&st)) != CRYPT_OK) return err; in sprng_test() 143 if ((err = sprng_done(&st)) != CRYPT_OK) return err; in sprng_test() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/ |
A D | der_encode_custom_type.c | 39 if ((err = der_length_custom_type(root, &y, &z)) != CRYPT_OK) return CRYPT_INVALID_ARG; in der_encode_custom_type() 66 if ((err = der_encode_asn1_length(z, &out[x], &y)) != CRYPT_OK) { in der_encode_custom_type() 90 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 97 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 111 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 166 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 173 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 180 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 187 if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 219 if ((err = der_encode_asn1_identifier(root, out, &id_len)) != CRYPT_OK) { in der_encode_custom_type() [all …]
|
A D | der_decode_custom_type.c | 86 if ((err = der_decode_asn1_identifier(in, &y, &ident)) != CRYPT_OK) { in der_decode_custom_type_ex() 138 seq_err = CRYPT_OK; in der_decode_custom_type_ex() 180 if ((err = der_length_boolean(&z)) != CRYPT_OK) { in der_decode_custom_type_ex() 191 if ((err = der_length_integer(data, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 352 err = CRYPT_OK; in der_decode_custom_type_ex() 354 if (err != CRYPT_OK) { in der_decode_custom_type_ex() 368 err = CRYPT_OK; in der_decode_custom_type_ex() 370 if (err != CRYPT_OK) { in der_decode_custom_type_ex() 408 if (blksize == x && seq_err == CRYPT_OK && inlen == 0) { in der_decode_custom_type_ex() 410 err = CRYPT_OK; in der_decode_custom_type_ex() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
A D | der_length_sequence.c | 52 if ((err = der_length_boolean(&x)) != CRYPT_OK) { in der_length_sequence_ex() 59 if ((err = der_length_integer(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 74 if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 81 if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 99 if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 120 if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 127 if ((err = der_length_generalizedtime(data, &x)) != CRYPT_OK) { in der_length_sequence_ex() 134 if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 150 if ((err = der_length_sequence(data, size, &x)) != CRYPT_OK) { in der_length_sequence_ex() 164 if ((err = der_length_asn1_length(y, &x)) != CRYPT_OK) { in der_length_sequence_ex() [all …]
|
A D | der_encode_sequence_ex.c | 50 if ((err = der_encode_asn1_length(z, &out[x], &y)) != CRYPT_OK) { in der_encode_sequence_ex() 69 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 76 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 90 if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 124 if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 145 if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 152 if ((err = der_encode_generalizedtime(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 159 if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 166 if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 180 if ((err = der_encode_custom_type(&list[i], out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() [all …]
|