| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/sequence/ |
| H A D | der_encode_sequence_ex.c | 27 unsigned long size, x, y, z, i; in der_encode_sequence_ex() local 35 y = 0; z = 0; in der_encode_sequence_ex() 36 if (der_length_sequence_ex(list, inlen, &y, &z) != CRYPT_OK) return CRYPT_INVALID_ARG; in der_encode_sequence_ex() 50 if ((err = der_encode_asn1_length(z, &out[x], &y)) != CRYPT_OK) { in der_encode_sequence_ex() 68 z = *outlen; in der_encode_sequence_ex() 69 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 75 z = *outlen; in der_encode_sequence_ex() 76 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() 82 z = *outlen; in der_encode_sequence_ex() 83 … if ((err = der_encode_short_integer(*((unsigned long*)data), out + x, &z)) != CRYPT_OK) { in der_encode_sequence_ex() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/ciphers/ |
| H A D | xtea.c | 70 ulong32 y, z; in xtea_ecb_encrypt() local 78 LOAD32H(z, &pt[4]); in xtea_ecb_encrypt() 80 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 81 z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 83 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+1])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 84 z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r+1])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 86 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+2])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 87 z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r+2])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 89 y = (y + ((((z<<4)^(z>>5)) + z) ^ skey->xtea.A[r+3])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() 90 z = (z + ((((y<<4)^(y>>5)) + y) ^ skey->xtea.B[r+3])) & 0xFFFFFFFFUL; in xtea_ecb_encrypt() [all …]
|
| H A D | cast5.c | 406 ulong32 x[4], z[4]; in s_cast5_setup() local 435 … z[3] = x[3] ^ S5[GB(x, 0xD)] ^ S6[GB(x, 0xF)] ^ S7[GB(x, 0xC)] ^ S8[GB(x, 0xE)] ^ S7[GB(x, 0x8)]; in s_cast5_setup() 436 … 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 s_cast5_setup() 437 … 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 s_cast5_setup() 438 … 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 s_cast5_setup() 439 …skey->cast5.K[i++] = S5[GB(z, 0x8)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0x7)] ^ S8[GB(z, 0x6)] ^ S5[GB(z, … in s_cast5_setup() 440 …skey->cast5.K[i++] = S5[GB(z, 0xA)] ^ S6[GB(z, 0xB)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S6[GB(z, … in s_cast5_setup() 441 …skey->cast5.K[i++] = S5[GB(z, 0xC)] ^ S6[GB(z, 0xd)] ^ S7[GB(z, 0x3)] ^ S8[GB(z, 0x2)] ^ S7[GB(z, … in s_cast5_setup() 442 …skey->cast5.K[i++] = S5[GB(z, 0xE)] ^ S6[GB(z, 0xF)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x0)] ^ S8[GB(z, … in s_cast5_setup() 444 … 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 s_cast5_setup() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/custom_type/ |
| H A D | der_encode_custom_type.c | 30 unsigned long size, x, y, z, i, inlen, id_len; in der_encode_custom_type() local 38 y = 0; z = 0; in der_encode_custom_type() 39 if (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() 89 z = *outlen; in der_encode_custom_type() 90 if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 96 z = *outlen; in der_encode_custom_type() 97 if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() 103 z = *outlen; in der_encode_custom_type() 104 … if ((err = der_encode_short_integer(*((unsigned long*)data), out + x, &z)) != CRYPT_OK) { in der_encode_custom_type() [all …]
|
| H A D | der_decode_custom_type.c | 50 unsigned long size, x, y, z, blksize; in der_decode_custom_type_ex() local 142 z = 0; in der_decode_custom_type_ex() 175 z = inlen; 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() 186 z = inlen; in der_decode_custom_type_ex() 187 if ((err = der_decode_integer(in + x, z, data)) != CRYPT_OK) { in der_decode_custom_type_ex() 191 if ((err = der_length_integer(data, &z)) != CRYPT_OK) { in der_decode_custom_type_ex() 197 z = inlen; in der_decode_custom_type_ex() 198 if ((err = der_decode_short_integer(in + x, z, data)) != CRYPT_OK) { in der_decode_custom_type_ex() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/choice/ |
| H A D | der_decode_choice.c | 23 unsigned long size, x, z; in der_decode_choice() local 48 if (der_length_boolean(&z) == CRYPT_OK) { in der_decode_choice() 50 *inlen = z; in der_decode_choice() 58 if (der_length_integer(data, &z) == CRYPT_OK) { in der_decode_choice() 60 *inlen = z; in der_decode_choice() 68 if (der_length_short_integer(*(unsigned long*)data, &z) == CRYPT_OK) { in der_decode_choice() 70 *inlen = z; in der_decode_choice() 78 if (der_length_bit_string(size, &z) == CRYPT_OK) { in der_decode_choice() 81 *inlen = z; in der_decode_choice() 89 if (der_length_bit_string(size, &z) == CRYPT_OK) { in der_decode_choice() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/short_integer/ |
| H A D | der_encode_short_integer.c | 22 unsigned long len, x, y, z; in der_encode_short_integer() local 42 z = 0; in der_encode_short_integer() 45 ++z; in der_encode_short_integer() 50 if (z == 0) { in der_encode_short_integer() 51 z = 1; in der_encode_short_integer() 55 z += (num&(1UL<<((z<<3) - 1))) ? 1 : 0; in der_encode_short_integer() 58 for (x = 0; (z <= 4) && (x < (4 - z)); x++) { in der_encode_short_integer() 65 out[x++] = (unsigned char)z; in der_encode_short_integer() 68 if (z == 5) { in der_encode_short_integer() 70 --z; in der_encode_short_integer() [all …]
|
| H A D | der_length_short_integer.c | 20 unsigned long z, y; in der_length_short_integer() local 29 z = 0; in der_length_short_integer() 32 ++z; in der_length_short_integer() 37 if (z == 0) { in der_length_short_integer() 38 z = 1; in der_length_short_integer() 39 } else if ((num&(1UL<<((z<<3) - 1))) != 0) { in der_length_short_integer() 41 ++z; in der_length_short_integer() 44 if ((err = der_length_asn1_length(z, &y)) != CRYPT_OK) { in der_length_short_integer() 47 *outlen = 1 + y + z; in der_length_short_integer()
|
| /optee_os/lib/libutils/isoc/arch/arm/softfloat/source/ |
| H A D | s_shiftRightJam128Extra.c | 49 struct uint128_extra z; in softfloat_shiftRightJam128Extra() local 53 z.v.v64 = a64>>count; in softfloat_shiftRightJam128Extra() 54 z.v.v0 = a64<<(negCount & 63) | a0>>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() [all …]
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H 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()
|
| H A D | s_add128.c | 47 struct uint128 z; in softfloat_add128() local 49 z.v0 = a0 + b0; in softfloat_add128() 50 z.v64 = a64 + b64 + (z.v0 < a0); in softfloat_add128() 51 return z; in softfloat_add128()
|
| /optee_os/core/lib/libtomcrypt/src/encauth/ccm/ |
| H A D | ccm_memory.c | 47 unsigned long len, L, x, y, z, CTRlen; in ccm_memory() local 238 for (z = 15; z > 15-L; z--) { in ccm_memory() 239 ctr[z] = (ctr[z] + 1) & 255; in ccm_memory() 240 if (ctr[z]) break; 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() 260 if (ctr[z]) break; in ccm_memory() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/object_identifier/ |
| H A D | der_length_object_identifier.c | 34 unsigned long y, z, t, wordbuf; in der_length_object_identifier() local 51 z = 0; in der_length_object_identifier() 55 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_length_object_identifier() 63 if (z < 128) { in der_length_object_identifier() 64 z += 2; in der_length_object_identifier() 65 } else if (z < 256) { in der_length_object_identifier() 66 z += 3; in der_length_object_identifier() 67 } else if (z < 65536UL) { in der_length_object_identifier() 68 z += 4; in der_length_object_identifier() 73 *outlen = z; in der_length_object_identifier()
|
| H A D | der_encode_object_identifier.c | 22 unsigned long i, x, y, z, t, mask, wordbuf; in der_encode_object_identifier() local 39 z = 0; in der_encode_object_identifier() 43 z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); in der_encode_object_identifier() 53 if ((err = der_encode_asn1_length(z, out + x, &y)) != CRYPT_OK) { in der_encode_object_identifier() 72 z = x - 1; in der_encode_object_identifier() 73 while (y < z) { in der_encode_object_identifier() 74 t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t; in der_encode_object_identifier() 76 --z; in der_encode_object_identifier()
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/utf8/ |
| H A D | der_decode_utf8_string.c | 25 unsigned long x, y, z, len; in der_decode_utf8_string() local 78 for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); in der_decode_utf8_string() 81 if (z == 1 || z > 4) { in der_decode_utf8_string() 86 tmp >>= z; in der_decode_utf8_string() 89 if (z > 0) { --z; } in der_decode_utf8_string() 91 if (x + z > len) { in der_decode_utf8_string() 96 while (z-- != 0) { in der_decode_utf8_string()
|
| /optee_os/core/lib/libtomcrypt/src/pk/asn1/der/integer/ |
| H A D | der_length_integer.c | 20 unsigned long z, len; in der_length_integer() local 41 z = mp_count_bits(num); in der_length_integer() 42 z = z + (8 - (z & 7)); in der_length_integer() 43 if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --z; in der_length_integer() 44 len = z >> 3; in der_length_integer() 47 if ((err = der_length_asn1_length(len, &z)) != CRYPT_OK) { in der_length_integer() 50 *outlen = 1 + z + len; in der_length_integer()
|
| /optee_os/lib/libutils/isoc/arch/arm/softfloat/source/include/ |
| H A D | primitives.h | 248 struct uint128 z; in softfloat_shortShiftLeft128() local 249 z.v64 = a64<<count | a0>>(-count & 63); in softfloat_shortShiftLeft128() 250 z.v0 = a0<<count; in softfloat_shortShiftLeft128() 251 return z; in softfloat_shortShiftLeft128() 269 struct uint128 z; in softfloat_shortShiftRight128() local 270 z.v64 = a64>>count; in softfloat_shortShiftRight128() 271 z.v0 = a64<<(-count & 63) | a0>>count; in softfloat_shortShiftRight128() 272 return z; in softfloat_shortShiftRight128() 291 struct uint64_extra z; in softfloat_shortShiftRightJam64Extra() local 292 z.v = a>>count; in softfloat_shortShiftRightJam64Extra() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/stream/sober128/ |
| H A D | sober128_stream.c | 44 #define STEP(R,z) \ argument 45 …R[OFF(z,0)] = R[OFF(z,15)] ^ R[OFF(z,4)] ^ (R[OFF(z,0)] << 8) ^ Multab[(R[OFF(z,0)] >> 24) & 0xFF]; 62 #define NLFUNC(st,z) \ argument 64 t = st->R[OFF(z,0)] + st->R[OFF(z,16)]; \ 67 t = ((t + st->R[OFF(z,1)]) ^ st->konst) + st->R[OFF(z,6)]; \ 69 t = t + st->R[OFF(z,13)]; \ 122 #define DROUND(z) STEP(st->R,z); NLFUNC(st,(z+1)); st->R[OFF((z+1),FOLDP)] ^= t; argument 235 #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/ |
| H A D | ltc_ecc_projective_add_point.c | 25 void *t1, *t2, *x, *y, *z; 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() 52 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() 55 mp_clear_multi(t1, t2, x, y, z, LTC_NULL); in ltc_ecc_projective_add_point() 68 if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 71 if (Q->z != NULL) { in ltc_ecc_projective_add_point() 73 if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 79 if ((err = mp_mul(Q->z, t1, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 87 if ((err = mp_sqr(z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 93 if ((err = mp_mul(z, t1, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
| /optee_os/core/lib/libtomcrypt/src/misc/base64/ |
| H A D | base64_decode.c | 82 unsigned long t, x, y, z; in s_base64_decode_internal() local 91 for (x = y = z = t = 0; x < inlen; x++) { in s_base64_decode_internal() 120 if (z + 3 > *outlen) return CRYPT_BUFFER_OVERFLOW; in s_base64_decode_internal() 121 out[z++] = (unsigned char)((t>>16)&255); in s_base64_decode_internal() 122 out[z++] = (unsigned char)((t>>8)&255); in s_base64_decode_internal() 123 out[z++] = (unsigned char)(t&255); in s_base64_decode_internal() 132 if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; in s_base64_decode_internal() 133 if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); in s_base64_decode_internal() 134 if (y == 3) out[z++] = (unsigned char) ((t >> 8) & 255); in s_base64_decode_internal() 136 *outlen = z; in s_base64_decode_internal()
|
| /optee_os/core/lib/libtomcrypt/src/misc/ |
| H A D | copy_or_zeromem.c | 21 unsigned long z; in copy_or_zeromem() local 36 for (z = 0; z < 16; z += sizeof(LTC_FAST_TYPE)) { in copy_or_zeromem() 37 *(LTC_FAST_TYPE_PTR_CAST(&dest[y+z])) = *(LTC_FAST_TYPE_PTR_CAST(&src[y+z])) & fastMask; in copy_or_zeromem()
|