/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
A D | der_encode_sequence_ex.c | 42 y = 0; z = 0; in der_encode_sequence_ex() 75 z = *outlen; in der_encode_sequence_ex() 82 z = *outlen; in der_encode_sequence_ex() 89 z = *outlen; in der_encode_sequence_ex() 96 z = *outlen; in der_encode_sequence_ex() 103 z = *outlen; in der_encode_sequence_ex() 110 z = *outlen; in der_encode_sequence_ex() 119 z = 2; in der_encode_sequence_ex() 123 z = *outlen; in der_encode_sequence_ex() 200 x += z; in der_encode_sequence_ex() [all …]
|
/optee_os/core/lib/libtomcrypt/src/ciphers/ |
A D | xtea.c | 77 ulong32 y, z; in xtea_ecb_encrypt() local 85 LOAD32H(z, &pt[4]); in xtea_ecb_encrypt() 87 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 90 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+1])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 93 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+2])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 96 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+3])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 113 ulong32 y, z; in xtea_ecb_decrypt() local 124 y = (y - ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r])) & 0xFFFFFFFFUL; in xtea_ecb_decrypt() 127 y = (y - ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r-1])) & 0xFFFFFFFFUL; in xtea_ecb_decrypt() 130 y = (y - ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r-2])) & 0xFFFFFFFFUL; in xtea_ecb_decrypt() [all …]
|
A D | cast5.c | 443 … z[2] = x[1] ^ S5[GB(z, 0x0)] ^ S6[GB(z, 0x2)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x3)] ^ S8[GB(x, 0xA)]; in _cast5_setup() 444 … z[1] = x[0] ^ S5[GB(z, 0x7)] ^ S6[GB(z, 0x6)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S5[GB(x, 0x9)]; in _cast5_setup() 445 … z[0] = x[2] ^ S5[GB(z, 0xA)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0xb)] ^ S8[GB(z, 0x8)] ^ S6[GB(x, 0xB)]; in _cast5_setup() 446 …skey->cast5.K[i++] = S5[GB(z, 0x8)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0x7)] ^ S8[GB(z, 0x6)] ^ S5[GB(z, … in _cast5_setup() 447 …skey->cast5.K[i++] = S5[GB(z, 0xA)] ^ S6[GB(z, 0xB)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S6[GB(z, … in _cast5_setup() 451 … x[3] = z[1] ^ S5[GB(z, 0x5)] ^ S6[GB(z, 0x7)] ^ S7[GB(z, 0x4)] ^ S8[GB(z, 0x6)] ^ S7[GB(z, 0x0)]; in _cast5_setup() 462 … z[2] = x[1] ^ S5[GB(z, 0x0)] ^ S6[GB(z, 0x2)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x3)] ^ S8[GB(x, 0xA)]; in _cast5_setup() 463 … z[1] = x[0] ^ S5[GB(z, 0x7)] ^ S6[GB(z, 0x6)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S5[GB(x, 0x9)]; in _cast5_setup() 464 … z[0] = x[2] ^ S5[GB(z, 0xA)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0xb)] ^ S8[GB(z, 0x8)] ^ S6[GB(x, 0xB)]; in _cast5_setup() 470 … x[3] = z[1] ^ S5[GB(z, 0x5)] ^ S6[GB(z, 0x7)] ^ S7[GB(z, 0x4)] ^ S8[GB(z, 0x6)] ^ S7[GB(z, 0x0)]; in _cast5_setup() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/ |
A D | der_encode_custom_type.c | 45 y = 0; z = 0; in der_encode_custom_type() 96 z = *outlen; in der_encode_custom_type() 103 z = *outlen; in der_encode_custom_type() 110 z = *outlen; in der_encode_custom_type() 117 z = *outlen; in der_encode_custom_type() 124 z = *outlen; in der_encode_custom_type() 131 z = *outlen; in der_encode_custom_type() 140 z = 2; in der_encode_custom_type() 144 z = *outlen; in der_encode_custom_type() 222 x += z; in der_encode_custom_type() [all …]
|
A D | der_decode_custom_type.c | 149 z = 0; in der_decode_custom_type_ex() 166 z = inlen; in der_decode_custom_type_ex() 177 z = inlen; in der_decode_custom_type_ex() 188 z = inlen; in der_decode_custom_type_ex() 200 z = inlen; in der_decode_custom_type_ex() 212 z = inlen; in der_decode_custom_type_ex() 224 z = inlen; in der_decode_custom_type_ex() 241 z = 2; in der_decode_custom_type_ex() 245 z = inlen; in der_decode_custom_type_ex() 383 x += z; in der_decode_custom_type_ex() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/ |
A D | der_decode_choice.c | 30 unsigned long size, x, z; in der_decode_choice() local 57 *inlen = z; in der_decode_choice() 67 *inlen = z; in der_decode_choice() 77 *inlen = z; in der_decode_choice() 88 *inlen = z; in der_decode_choice() 99 *inlen = z; in der_decode_choice() 110 *inlen = z; in der_decode_choice() 180 z = *inlen; in der_decode_choice() 183 *inlen = z; in der_decode_choice() 189 z = *inlen; in der_decode_choice() [all …]
|
/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_memory.c | 238 for (z = 15; z > 15-L; z--) { in ccm_memory() 239 ctr[z] = (ctr[z] + 1) & 255; in ccm_memory() 247 for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { in ccm_memory() 248 *(LTC_FAST_TYPE_PTR_CAST(&PAD[z])) ^= *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])); in ccm_memory() 249 …*(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) ^ *(LTC_FAST_TYPE_PTR_CA… in ccm_memory() 258 for (z = 15; z > 15-L; z--) { in ccm_memory() 259 ctr[z] = (ctr[z] + 1) & 255; in ccm_memory() 267 for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { in ccm_memory() 268 …*(LTC_FAST_TYPE_PTR_CAST(&pt[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&ct[y+z])) ^ *(LTC_FAST_TYPE_PTR_CA… in ccm_memory() 282 for (z = 15; z > 15-L; z--) { in ccm_memory() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/ |
A D | der_encode_short_integer.c | 29 unsigned long len, x, y, z; in der_encode_short_integer() local 49 z = 0; in der_encode_short_integer() 52 ++z; in der_encode_short_integer() 57 if (z == 0) { in der_encode_short_integer() 58 z = 1; in der_encode_short_integer() 62 z += (num&(1UL<<((z<<3) - 1))) ? 1 : 0; in der_encode_short_integer() 65 for (x = 0; (z <= 4) && (x < (4 - z)); x++) { in der_encode_short_integer() 72 out[x++] = (unsigned char)z; in der_encode_short_integer() 75 if (z == 5) { in der_encode_short_integer() 77 --z; in der_encode_short_integer() [all …]
|
A D | der_length_short_integer.c | 27 unsigned long z, y; in der_length_short_integer() local 36 z = 0; in der_length_short_integer() 39 ++z; in der_length_short_integer() 44 if (z == 0) { in der_length_short_integer() 45 z = 1; in der_length_short_integer() 46 } else if ((num&(1UL<<((z<<3) - 1))) != 0) { in der_length_short_integer() 48 ++z; in der_length_short_integer() 51 if ((err = der_length_asn1_length(z, &y)) != CRYPT_OK) { in der_length_short_integer() 54 *outlen = 1 + y + z; in der_length_short_integer()
|
/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ |
A D | s_shiftRightJam128Extra.c | 49 struct uint128_extra z; in softfloat_shiftRightJam128Extra() local 53 z.v.v64 = a64>>count; in softfloat_shiftRightJam128Extra() 55 z.extra = a0<<(negCount & 63); in softfloat_shiftRightJam128Extra() 57 z.v.v64 = 0; in softfloat_shiftRightJam128Extra() 59 z.v.v0 = a64; in softfloat_shiftRightJam128Extra() 60 z.extra = a0; in softfloat_shiftRightJam128Extra() 64 z.v.v0 = a64>>(count & 63); in softfloat_shiftRightJam128Extra() 65 z.extra = a64<<(negCount & 63); in softfloat_shiftRightJam128Extra() 67 z.v.v0 = 0; in softfloat_shiftRightJam128Extra() 72 z.extra |= (extra != 0); in softfloat_shiftRightJam128Extra() [all …]
|
A D | s_normSubnormalF128Sig.c | 46 struct exp32_sig128 z; in softfloat_normSubnormalF128Sig() local 50 z.exp = -63 - shiftCount; in softfloat_normSubnormalF128Sig() 52 z.sig.v64 = sig0>>-shiftCount; in softfloat_normSubnormalF128Sig() 53 z.sig.v0 = sig0<<(shiftCount & 63); in softfloat_normSubnormalF128Sig() 55 z.sig.v64 = sig0<<shiftCount; in softfloat_normSubnormalF128Sig() 56 z.sig.v0 = 0; in softfloat_normSubnormalF128Sig() 60 z.exp = 1 - shiftCount; in softfloat_normSubnormalF128Sig() 61 z.sig = softfloat_shortShiftLeft128( sig64, sig0, shiftCount ); in softfloat_normSubnormalF128Sig() 63 return z; in softfloat_normSubnormalF128Sig()
|
A D | s_mul64To128.c | 47 struct uint128 z; in softfloat_mul64To128() local 54 z.v0 = (uint_fast64_t) a0 * b0; in softfloat_mul64To128() 57 z.v64 = (uint_fast64_t) a32 * b32; in softfloat_mul64To128() 58 z.v64 += (uint_fast64_t) (mid < mid1)<<32 | mid>>32; in softfloat_mul64To128() 60 z.v0 += mid; in softfloat_mul64To128() 61 z.v64 += (z.v0 < mid); in softfloat_mul64To128() 62 return z; in softfloat_mul64To128()
|
A D | s_shiftRightJam64Extra.c | 48 struct uint64_extra z; in softfloat_shiftRightJam64Extra() local 51 z.v = a>>count; in softfloat_shiftRightJam64Extra() 52 z.extra = a<<(-count & 63); in softfloat_shiftRightJam64Extra() 54 z.v = 0; in softfloat_shiftRightJam64Extra() 55 z.extra = (count == 64) ? a : (a != 0); in softfloat_shiftRightJam64Extra() 57 z.extra |= (extra != 0); in softfloat_shiftRightJam64Extra() 58 return z; in softfloat_shiftRightJam64Extra()
|
A D | extF80M_to_ui64_r_minMag.c | 63 uint64_t z; in extF80M_to_ui64_r_minMag() local 83 z = sig<<shiftCount; in extF80M_to_ui64_r_minMag() 84 if ( z>>shiftCount != sig ) goto invalid; in extF80M_to_ui64_r_minMag() 86 z = sig; in extF80M_to_ui64_r_minMag() 87 if ( shiftCount ) z >>= shiftCount; in extF80M_to_ui64_r_minMag() 88 if ( sign && z ) goto invalid; in extF80M_to_ui64_r_minMag() 89 if ( exact && shiftCount && (z<<shiftCount != sig) ) { in extF80M_to_ui64_r_minMag() 93 return z; in extF80M_to_ui64_r_minMag()
|
A D | s_shiftRightJam128.c | 48 struct uint128 z; in softfloat_shiftRightJam128() local 52 z.v64 = a64>>count; in softfloat_shiftRightJam128() 53 z.v0 = in softfloat_shiftRightJam128() 57 z.v64 = 0; in softfloat_shiftRightJam128() 58 z.v0 = in softfloat_shiftRightJam128() 65 return z; in softfloat_shiftRightJam128()
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/ |
A D | der_length_object_identifier.c | 41 unsigned long y, z, t, wordbuf; in der_length_object_identifier() local 58 z = 0; in der_length_object_identifier() 62 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_length_object_identifier() 70 if (z < 128) { in der_length_object_identifier() 71 z += 2; in der_length_object_identifier() 72 } else if (z < 256) { in der_length_object_identifier() 73 z += 3; in der_length_object_identifier() 74 } else if (z < 65536UL) { in der_length_object_identifier() 75 z += 4; in der_length_object_identifier() 80 *outlen = z; in der_length_object_identifier()
|
A D | der_encode_object_identifier.c | 29 unsigned long i, x, y, z, t, mask, wordbuf; in der_encode_object_identifier() local 46 z = 0; in der_encode_object_identifier() 50 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_encode_object_identifier() 60 if ((err = der_encode_asn1_length(z, out + x, &y)) != CRYPT_OK) { in der_encode_object_identifier() 79 z = x - 1; in der_encode_object_identifier() 80 while (y < z) { in der_encode_object_identifier() 81 t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; in der_encode_object_identifier() 83 --z; in der_encode_object_identifier()
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/ |
A D | der_decode_utf8_string.c | 32 unsigned long x, y, z, len; in der_decode_utf8_string() local 67 for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); in der_decode_utf8_string() 69 if (z == 1 || z > 4 || (x + (z - 1) > inlen)) { in der_decode_utf8_string() 74 tmp >>= z; in der_decode_utf8_string() 77 if (z > 1) { --z; } in der_decode_utf8_string() 78 while (z-- != 0) { in der_decode_utf8_string()
|
/optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/ |
A D | primitives.h | 251 return z; in softfloat_shortShiftLeft128() 272 return z; in softfloat_shortShiftRight128() 294 return z; in softfloat_shortShiftRightJam64Extra() 320 z.v0 = in softfloat_shortShiftRightJam128() 323 return z; in softfloat_shortShiftRightJam128() 348 return z; in softfloat_shortShiftRightJam128Extra() 389 return z; in softfloat_shiftRightJam64Extra() 467 z.v64 = a64 + b64 + (z.v0 < a0); in softfloat_add128() 468 return z; in softfloat_add128() 504 return z; in softfloat_sub128() [all …]
|
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/ |
A D | der_length_integer.c | 27 unsigned long z, len; in der_length_integer() local 48 z = mp_count_bits(num); in der_length_integer() 49 z = z + (8 - (z & 7)); in der_length_integer() 50 if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --z; in der_length_integer() 51 len = z >> 3; in der_length_integer() 54 if ((err = der_length_asn1_length(len, &z)) != CRYPT_OK) { in der_length_integer() 57 *outlen = 1 + z + len; in der_length_integer()
|
/optee_os/core/lib/libtomcrypt/src/stream/sober128/ |
A D | sober128_stream.c | 51 #define STEP(R,z) \ argument 52 …R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF]; 69 #define NLFUNC(st,z) \ argument 71 t = st->R[OFF(z,0)] + st->R[OFF(z,16)]; \ 74 t = ((t + st->R[OFF(z,1)]) ^ st->konst) + st->R[OFF(z,6)]; \ 76 t = t + st->R[OFF(z,13)]; \ 129 #define DROUND(z) STEP(st->R,z); NLFUNC(st,(z+1)); st->R[OFF((z+1),FOLDP)] ^= t; argument 242 #define SROUND(z) STEP(st->R,z); NLFUNC(st,(z+1)); XORWORD(t, in+(z*4), out+(z*4)); argument
|
/optee_os/core/lib/libtomcrypt/src/pk/ecc/ |
A D | ltc_ecc_projective_add_point.c | 32 void *t1, *t2, *x, *y, *z; in ltc_ecc_projective_add_point() local 41 if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) { in ltc_ecc_projective_add_point() 59 if ((mp_cmp(P->x, Q->x) == LTC_MP_EQ) && (mp_cmp(P->z, Q->z) == LTC_MP_EQ)) { in ltc_ecc_projective_add_point() 62 mp_clear_multi(t1, t2, x, y, z, NULL); in ltc_ecc_projective_add_point() 75 if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 78 if (Q->z != NULL) { in ltc_ecc_projective_add_point() 138 if (Q->z != NULL) { in ltc_ecc_projective_add_point() 140 if ((err = mp_mul(z, Q->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 145 if ((err = mp_mul(z, x, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 196 if ((err = mp_copy(z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
/optee_os/core/lib/libtomcrypt/src/misc/base64/ |
A D | base64_decode.c | 89 unsigned long t, x, y, z; in _base64_decode_internal() local 98 for (x = y = z = t = 0; x < inlen; x++) { in _base64_decode_internal() 127 if (z + 3 > *outlen) return CRYPT_BUFFER_OVERFLOW; in _base64_decode_internal() 128 out[z++] = (unsigned char)((t>>16)&255); in _base64_decode_internal() 129 out[z++] = (unsigned char)((t>>8)&255); in _base64_decode_internal() 130 out[z++] = (unsigned char)(t&255); in _base64_decode_internal() 139 if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; in _base64_decode_internal() 140 if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); in _base64_decode_internal() 141 if (y == 3) out[z++] = (unsigned char) ((t >> 8) & 255); in _base64_decode_internal() 143 *outlen = z; in _base64_decode_internal()
|
/optee_os/core/lib/libtomcrypt/src/math/fp/ |
A D | ltc_ecc_fp_mulmod.c | 579 int y, z; in _find_hole() local 582 z = x; in _find_hole() 595 if (z >= 0 && fp_cache[z].g) { in _find_hole() 608 return z; in _find_hole() 619 mp_cmp(fp_cache[x].g->z, g->z) == LTC_MP_EQ) { in _find_base() 643 (mp_copy(g->z, fp_cache[idx].g->z) != CRYPT_OK)) { in _add_entry() 856 z = kb[x]; kb[x] = kb[y]; kb[y] = z; in _accel_fp_mul() 889 z = 0; in _accel_fp_mul() 1025 z = kb[0][x]; kb[0][x] = kb[0][y]; kb[0][y] = z; in _accel_fp_mul2add() 1043 z = kb[1][x]; kb[1][x] = kb[1][y]; kb[1][y] = z; in _accel_fp_mul2add() [all …]
|
/optee_os/core/lib/libtomcrypt/src/misc/ |
A D | copy_or_zeromem.c | 28 unsigned long z; in copy_or_zeromem() local 43 for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { in copy_or_zeromem() 44 *(LTC_FAST_TYPE_PTR_CAST(&dest[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&src[y+z])) & fastMask; in copy_or_zeromem()
|