Home
last modified time | relevance | path

Searched +full:- +full:j (Results 1 – 25 of 133) sorted by relevance

123456

/optee_os/core/lib/libtomcrypt/src/pk/asn1/oid/
H A Dpk_oid_str.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
8 unsigned long i, j, limit, oid_j; in pk_oid_str_to_num() local
22 for (i = 0, j = 0; i < OID_len; i++) { in pk_oid_str_to_num()
24 if (++j >= limit) continue; in pk_oid_str_to_num()
27 if ((j >= limit) || (oid == NULL)) continue; in pk_oid_str_to_num()
28 oid_j = oid[j]; in pk_oid_str_to_num()
29 oid[j] = oid[j] * 10 + (OID[i] - '0'); in pk_oid_str_to_num()
30 if (oid[j] < oid_j) return CRYPT_OVERFLOW; in pk_oid_str_to_num()
36 if (j == 0) return CRYPT_ERROR; in pk_oid_str_to_num()
[all …]
/optee_os/core/lib/libtomcrypt/src/misc/pkcs12/
H A Dpkcs12_kdf.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
14 unsigned long u = hash_descriptor[hash_id]->hashsize; in pkcs12_kdf()
15 unsigned long v = hash_descriptor[hash_id]->blocksize; in pkcs12_kdf()
16 unsigned long c = (outlen + u - 1) / u; in pkcs12_kdf()
17 unsigned long Slen = ((saltlen + v - 1) / v) * v; in pkcs12_kdf()
18 unsigned long Plen = ((pwlen + v - 1) / v) * v; in pkcs12_kdf()
21 unsigned int tmp, i, j, n; in pkcs12_kdf() local
36 for (i = 0; i < v; i++) D[i] = purpose; /* D - diversifier */ in pkcs12_kdf()
44 for (j = 1; j < iterations; j++) { in pkcs12_kdf()
[all …]
/optee_os/lib/libutils/isoc/newlib/
H A Dstr-two-way.h1 /* SPDX-License-Identifier: BSD-3-Clause */
3 * Copyright (c) 1994-2009 Red Hat, Inc.
33 /* Byte-wise substring search, using the Two-Way algorithm.
42 AVAILABLE(h, h_l, j, n_l) A macro that returns nonzero if there are
44 H[J]. H is 'unsigned char *', H_L, J,
46 lvalue. For NUL-terminated searches,
51 For case-insensitivity, you may optionally define:
67 /* We use the Two-Way string matching algorithm, which guarantees
70 Boyer-Moore algorithm to achieve improved (potentially sub-linear)
73 See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260
[all …]
/optee_os/core/crypto/
H A Dsm3.c1 // SPDX-License-Identifier: BSD-2-Clause
10 * 2011-10-26
40 ctx->total[0] = 0; in sm3_init()
41 ctx->total[1] = 0; in sm3_init()
43 ctx->state[0] = 0x7380166F; in sm3_init()
44 ctx->state[1] = 0x4914B2B9; in sm3_init()
45 ctx->state[2] = 0x172442D7; in sm3_init()
46 ctx->state[3] = 0xDA8A0600; in sm3_init()
47 ctx->state[4] = 0xA96F30BC; in sm3_init()
48 ctx->state[5] = 0x163138AA; in sm3_init()
[all …]
H A Daes-gcm-ghash-tbl.c1 // SPDX-License-Identifier: Apache-2.0
3 * Copyright (c) 2017-2020, Linaro Limited
5 * NIST SP800-38D compliant GCM implementation
7 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
13 * http://www.apache.org/licenses/LICENSE-2.0
23 #include <crypto/internal_aes-gcm.h>
30 * http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
34 gcm-revised-spec.pdf
36 * We use the algorithm described as Shoup's method with 4-bit tables in
37 * [MGV] 4.1, pp. 12-13, to enhance speed without using too much memory.
[all …]
/optee_os/core/arch/arm/plat-hikey/
H A Dspi_test.c1 // SPDX-License-Identifier: BSD-2-Clause
32 pd.chip.ops->set_interrupt(NULL, GPIO6_2, in spi_cs_callback()
34 pd.chip.ops->set_direction(NULL, GPIO6_2, GPIO_DIR_OUT); in spi_cs_callback()
39 DMSG("pl022 busy - do NOT set CS!"); in spi_cs_callback()
42 DMSG("pl022 done - set CS!"); in spi_cs_callback()
44 pd.chip.ops->set_value(NULL, GPIO6_2, value); in spi_cs_callback()
75 size_t i, j, len = 3; in spi_test_with_manual_cs_control() local
93 pd.chip.ops->configure(&pd.chip); in spi_test_with_manual_cs_control()
94 pd.chip.ops->start(&pd.chip); in spi_test_with_manual_cs_control()
103 for (j = 0; j < 10; j++) { in spi_test_with_manual_cs_control()
[all …]
/optee_os/core/lib/libtomcrypt/src/hashes/
H A Dmd2.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
54 int j; in s_md2_update_chksum() local
56 L = md->md2.chksum[15]; in s_md2_update_chksum()
57 for (j = 0; j < 16; j++) { in s_md2_update_chksum()
59 /* caution, the RFC says its "C[j] = S[M[i*16+j] xor L]" but the reference source code [and test ve… in s_md2_update_chksum()
62 L = (md->md2.chksum[j] ^= PI_SUBST[(int)(md->md2.buf[j] ^ L)] & 255); in s_md2_update_chksum()
68 int j, k; in s_md2_compress() local
72 for (j = 0; j < 16; j++) { in s_md2_compress()
73 md->md2.X[16+j] = md->md2.buf[j]; in s_md2_compress()
[all …]
H A Dsha3.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
12 "sha3-224", /* name of hash */
27 "sha3-256", /* name of hash */
42 "sha3-384", /* name of hash */
57 "sha3-512", /* name of hash */
159 int i, j, round; in s_keccakf() local
169 for(j = 0; j < 25; j += 5) { in s_keccakf()
170 s[j + i] ^= t; in s_keccakf()
176 j = s_keccakf_piln[i]; in s_keccakf()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/ecc/
H A Dltc_ecc_mulmod.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
29 int i, j, err, inf; in ltc_ecc_mulmod() local
50 /* for curves with a == -3 keep ma == NULL */ in ltc_ecc_mulmod()
62 for (j = 0; j < i; j++) { in ltc_ecc_mulmod()
63 ltc_ecc_del_point(M[j]); in ltc_ecc_mulmod()
78 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
79 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
80 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
92 for (j = 9; j < 16; j++) { in ltc_ecc_mulmod()
[all …]
/optee_os/core/arch/riscv/kernel/
H A Dthread_optee_abi_rv.S1 /* SPDX-License-Identifier: BSD-2-Clause */
8 #include <generated/asm-defines.h>
21 * untrusted domain and trusted domain. It could be an SBI/ECALL-based to
22 * a security monitor running in M-Mode and panic or messaging-based across
80 addi sp, sp, -REGOFF(8)
117 /* Early load rv[] into s2-s4 */
145 /* Store a0-a3 into rv[] */
180 j thread_return_to_udomain
184 addi sp, sp, -THREAD_ABI_ARGS_SIZE
193 j thread_return_to_udomain
[all …]
/optee_os/core/lib/libtomcrypt/src/ciphers/safer/
H A Dsafer.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
8 * LTC_DESCRIPTION: block-cipher algorithm LTC_SAFER (Secure And Fast Encryption
9 * Routine) in its four versions: LTC_SAFER K-64, LTC_SAFER K-128,
10 * LTC_SAFER SK-64 and LTC_SAFER SK-128.
15 * CH-8092 Zuerich, Switzerland
31 "safer-k64",
43 "safer-sk64",
55 "safer-k128",
67 "safer-sk128",
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/ec25519/
H A Dtweetnacl.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
33 return (1 & ((d - 1) >> 8)) - 1; in vn()
54 o[(i+1)*(i<15)]+=c-1+37*(c-1)*(i==15); in car25519()
55 o[i]-=c<<16; in car25519()
61 i64 t,i,c=~(b-1); in sel25519()
71 int i,j,b; in pack25519() local
77 FOR(j,2) { in pack25519()
78 m[0]=t[0]-0xffed; in pack25519()
80 m[i]=t[i]-0xffff-((m[i-1]>>16)&1); in pack25519()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/salsa20/
H A Dsalsa20_crypt.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
6 * and salsa20-ref.c version 20051118
7 * Public domain from D. J. Bernstein
25 for (i = rounds; i > 0; i -= 2) { in s_salsa20_block()
52 unsigned long i, j; in salsa20_crypt() local
59 LTC_ARGCHK(st->ivlen == 8 || st->ivlen == 24); in salsa20_crypt()
61 if (st->ksleft > 0) { in salsa20_crypt()
62 j = MIN(st->ksleft, inlen); in salsa20_crypt()
63 for (i = 0; i < j; ++i, st->ksleft--) out[i] = in[i] ^ st->kstream[64 - st->ksleft]; in salsa20_crypt()
[all …]
/optee_os/core/tee/
H A Dtee_cryp_pbkdf2.c1 // SPDX-License-Identifier: BSD-2-Clause
33 size_t i, j; in pbkdf2_f() local
36 for (i = 1; i <= p->iteration_count; i++) { in pbkdf2_f()
37 res = crypto_mac_init(h->ctx, p->password, p->password_len); in pbkdf2_f()
42 if (p->salt && p->salt_len) { in pbkdf2_f()
43 res = crypto_mac_update(h->ctx, p->salt, in pbkdf2_f()
44 p->salt_len); in pbkdf2_f()
51 res = crypto_mac_update(h->ctx, (uint8_t *)&be_index, in pbkdf2_f()
56 res = crypto_mac_update(h->ctx, u, h->hash_len); in pbkdf2_f()
61 res = crypto_mac_final(h->ctx, u, sizeof(u)); in pbkdf2_f()
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/chacha/
H A Dchacha_crypt.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
5 * chacha-ref.c version 20080118
6 * Public domain from D. J. Bernstein
24 for (i = rounds; i > 0; i -= 2) { in s_chacha_block()
51 unsigned long i, j; in chacha_crypt() local
58 LTC_ARGCHK(st->ivlen != 0); in chacha_crypt()
60 if (st->ksleft > 0) { in chacha_crypt()
61 j = MIN(st->ksleft, inlen); in chacha_crypt()
62 for (i = 0; i < j; ++i, st->ksleft--) out[i] = in[i] ^ st->kstream[64 - st->ksleft]; in chacha_crypt()
[all …]
/optee_os/core/drivers/
H A Dstm32_hsem.c1 // SPDX-License-Identifier: BSD-2-Clause
3 * Copyright (c) 2022-2024, STMicroelectronics
26 #define HSEM_CnCIDCFGR(x) (U(0x220) + U(0x004) * ((x) - 1))
76 unsigned int j = 0; in apply_rif_config() local
79 * When TDCID, OP-TEE should be the one to set the CID filtering in apply_rif_config()
85 io_clrbits32(hsem_d->base + HSEM_CnCIDCFGR(i + 1), in apply_rif_config()
90 io_clrbits32(hsem_d->base + HSEM_GpCIDCFGR(i), in apply_rif_config()
95 io_clrsetbits32(hsem_d->base + HSEM_SECCFGR, in apply_rif_config()
96 HSEM_SECCFGR_MASK & hsem_d->conf_data.access_mask[0], in apply_rif_config()
97 hsem_d->conf_data.sec_conf[0]); in apply_rif_config()
[all …]
H A Dffa_console.c1 // SPDX-License-Identifier: BSD-2-Clause
3 * Copyright (c) 2024-2025, NVIDIA CORPORATION
28 size_t j = 0; in copy_buf_to_args() local
30 args->a1 = len; in copy_buf_to_args()
32 for (i = 0, j = 0; j < len; i++, j += reg_size) in copy_buf_to_args()
33 memcpy(&args->a2 + i, buf + j, MIN(len - j, reg_size)); in copy_buf_to_args()
44 copy_buf_to_args(&args, pd->buf, pd->pos, sizeof(uint32_t)); in ffa_console_32_flush()
46 pd->pos = 0; in ffa_console_32_flush()
54 pd->buf[pd->pos++] = ch; in ffa_console_32_putc()
56 if (pd->pos == FFA_CONSOLE_LOG_32_MAX_MSG_LEN) in ffa_console_32_putc()
[all …]
H A Dpl022_spi.c1 // SPDX-License-Identifier: BSD-2-Clause
143 size_t j = 0; in pl022_txrx8() local
147 if (pd->data_size_bits != 8) { in pl022_txrx8()
149 pd->data_size_bits); in pl022_txrx8()
155 if (io_read8(pd->base + SSPSR) & SSPSR_TNF) { in pl022_txrx8()
157 io_write8(pd->base + SSPDR, wdat[i++]); in pl022_txrx8()
161 if (io_read8(pd->base + SSPSR) & SSPSR_RNE) { in pl022_txrx8()
163 rdat[j++] = io_read8(pd->base + SSPDR); in pl022_txrx8()
169 while ((j < num_pkts) && in pl022_txrx8()
170 (io_read8(pd->base + SSPSR) & SSPSR_RNE)) { in pl022_txrx8()
[all …]
/optee_os/lib/libutee/
H A Dtcb.c1 // SPDX-License-Identifier: BSD-2-Clause
6 * Support for Thread-Local Storage (TLS) ABIs for ARMv7/Aarch32 and Aarch64.
8 * TAs are currently single-threaded, so the only benefit of implementing these
10 * single-threaded. Such as, the g++ compiler from the GCC toolchain targeting a
11 * "Posix thread" Linux runtime, which OP-TEE has been using for quite some time
12 * (arm-linux-gnueabihf-* and aarch64-linux-gnu-*). This allows building C++ TAs
13 * without having to build a specific toolchain with --disable-threads.
17 * - "TLS data structures variant 1" (section 3): the AArch64 compiler uses the
21 * - The "General Dynamic access model" (section 4.1): the ARMv7/Aarch32
31 * [1] "ELF Handling For Thread-Local Storage"
[all …]
/optee_os/core/lib/libtomcrypt/src/stream/rc4/
H A Drc4_stream.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
12 @param keylen The length of the secret key (8 - 256 bytes)
19 unsigned long j; in rc4_stream_setup() local
23 LTC_ARGCHK(keylen >= 5); /* 40-2048 bits */ in rc4_stream_setup()
25 s = st->buf; in rc4_stream_setup()
30 for (j = x = y = 0; x < 256; x++) { in rc4_stream_setup()
31 y = (y + s[x] + key[j++]) & 255; in rc4_stream_setup()
32 if (j == keylen) { in rc4_stream_setup()
33 j = 0; in rc4_stream_setup()
[all …]
/optee_os/.github/workflows/
H A Dci.yml6 group: ci-${{ github.ref }} # unique per branch
7 cancel-in-progress: true # cancel previous runs on the same branch
11 runs-on: ubuntu-latest
14 - name: Checkout
17 fetch-depth: 0 # full history so checkpatch can check commit IDs in commit messages
18 - name: Update Git config
19 run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
20 - name: Run checkpatch
24 set -e
26 mkdir -p /tmp/linux/scripts
[all …]
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dbignum.c2 * Multi-precision integer library
5 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 * The following sources were referenced in the design of this Multi-precision
12 * [1] Handbook of Applied Cryptography - 1997
15 * [2] Multi-Precision Math
19 * [3] GNU Multi-Precision Arithmetic Library
48 * (MPI sign is the field s in mbedtls_mpi. It is unsigned short and only 1 and -1 are valid
54 return (signed short) mbedtls_ct_uint_if(cond, sign1 + 1, sign2 + 1) - 1; in mbedtls_ct_mpi_sign_if()
66 if (X->n != Y->n) { in mbedtls_mpi_lt_mpi_ct()
72 * We know that N->s == 1 if N >= 0 and N->s == -1 if N < 0. in mbedtls_mpi_lt_mpi_ct()
[all …]
/optee_os/core/lib/libtomcrypt/src/ciphers/
H A Drc5.c1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
51 ulong32 L[64], *S, A, B, i, j, v, s, t, l; in s_rc5_setup() local
70 skey->rc5.rounds = num_rounds; in s_rc5_setup()
71 S = skey->rc5.K; in s_rc5_setup()
74 for (A = i = j = 0; i < (ulong32)keylen; ) { in s_rc5_setup()
77 L[j++] = BSWAP(A); in s_rc5_setup()
83 A <<= (ulong32)((8 * (4 - (keylen&3)))); in s_rc5_setup()
84 L[j++] = BSWAP(A); in s_rc5_setup()
92 s = 3 * MAX(t, j); in s_rc5_setup()
[all …]
/optee_os/core/lib/zlib/
H A Dzutil.c1 // SPDX-License-Identifier: Zlib
2 /* zutil.c -- target dependent utility functions for the compression library
3 * Copyright (C) 1995-2017 Jean-loup Gailly
18 (z_const char *)"file error", /* Z_ERRNO (-1) */
19 (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */
20 (z_const char *)"data error", /* Z_DATA_ERROR (-3) */
21 (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */
22 (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */
23 (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
141 /* The older Microsoft C Run-Time Library for Windows CE doesn't have
[all …]
/optee_os/core/arch/arm/crypto/
H A Daes_armv8a_ce.c1 // SPDX-License-Identifier: BSD-2-Clause
5 * Copyright (c) 2001-2007, Tom St Denis
31 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
61 return (val >> shift) | (val << (32 - shift)); in ror32()
77 rko[0] = ror32(ce_aes_sub(rki[kwords - 1]), 8) ^ in expand_enc_key()
104 unsigned int j = round_count; in make_dec_key() local
112 j = round_count; in make_dec_key()
114 key_dec[0] = key_enc[j]; in make_dec_key()
115 for (i = 1, j--; j > 0; i++, j--) in make_dec_key()
116 ce_aes_invert(key_dec + i, key_enc + j); in make_dec_key()
[all …]

123456