Open hallowsman opened 3 weeks ago
when i use
uint32_t num_u32 = TEE_BigIntSizeInU32(1024); size_t len = num_u32 sizeof(uint32_t); uint8_t value[] = { 0x03, 0x05, 0x07}; TEE_BigInt par0 = (TEE_BigInt *)TEE_Malloc(len, TEE_MALLOC_FILL_ZERO); TEE_BigIntInit(par0, num_u32);
TEE_Result result = TEE_BigIntConvertFromOctetString(par0, value, sizeof(value) , 1);
it works well,par0 is right;
### but when i want to set uint8_t value_second[] = { 0x06, 0xc7, 0x1c, 0xc5, 0x08, 0x5f, 0xab, 0x4f, 0xf7, 0xe0, 0x22, 0xc9, 0x1c, 0x45, 0x8a, 0xc2, 0x6f, 0x6f, 0x94, 0xe9, 0xdb, 0x7c, 0x8f, 0xa9, 0x0a, 0x13, 0x05, 0x8d, 0x83, 0xb2, 0x37, 0x96, 0x75, 0x00, 0x35, 0xc4, 0xe8, 0x78, 0xb1, 0x28, 0x76, 0xf8, 0xe5, 0x96, 0xfb, 0xd6, 0x4b, 0x9f, 0x61, 0x95, 0xbb, 0x5f, 0xf8, 0x37, 0x9c, 0xdd, 0xb7, 0xe7, 0xf8, 0x2f, 0xde, 0x11, 0x89, 0x4b, 0x15, 0xb4, 0xc4, 0xd5, 0x87, 0xa7, 0xa3, 0x46, 0xd0, 0xc6, 0x2c, 0xb3, 0x0f, 0x0f, 0x78, 0x71, 0xeb, 0xf7, 0xbc, 0x27, 0xd5, 0x93, 0x15, 0xb0, 0xe1, 0x93, 0xd3, 0x3c, 0xd0, 0x27, 0xc6, 0x42, 0x68, 0x46, 0x18, 0xb4, 0x35, 0xde, 0x39, 0x82, 0x07, 0xc4, 0xea, 0x08, 0x0d, 0x7c, 0x85, 0xd0, 0xc0, 0x05, 0xb3, 0x00, 0xdd, 0xbc, 0xe1, 0x4c, 0x64, 0x01, 0xc6, 0x06, 0xce, 0x2a, 0x45, 0x1e, 0xb5, 0x98, 0xcb, 0x3c, 0x98, 0x94, 0x6f, 0x50, 0xba, 0x26, 0x75, 0x3b, 0x6c, 0x24, 0x8b, 0x90, 0xe4, 0xab, 0x58, 0x2d, 0x03, 0xd8, 0x28, 0xd1, 0x47, 0x56, 0x1d, 0x48, 0x4f, 0x46, 0xd4, 0x18, 0x46, 0x3f, 0x5b, 0x67, 0x89, 0x82, 0x8a, 0x8a, 0x15, 0xd3, 0x31, 0x0e, 0x38, 0xe3, 0x8e, 0x39
};
TEE_BigInt par1 = (TEE_BigInt )TEE_Malloc(len, TEE_MALLOC_FILL_ZERO); TEE_BigIntInit(par1, num_u32); convert to TEE_Result result = TEE_BigIntConvertFromOctetString(par1, value_second, sizeof(value_second), 1);
_### it shows fail TEEResult: 0xffff300f
what can i do make it right ???
0xffff300f is TEE_ERROR_OVERFLOW so it seems that num_u32 to too small.
0xffff300f
TEE_ERROR_OVERFLOW
num_u32
when i use
uint32_t num_u32 = TEE_BigIntSizeInU32(1024); size_t len = num_u32 sizeof(uint32_t); uint8_t value[] = { 0x03, 0x05, 0x07}; TEE_BigInt par0 = (TEE_BigInt *)TEE_Malloc(len, TEE_MALLOC_FILL_ZERO); TEE_BigIntInit(par0, num_u32);
TEE_Result result = TEE_BigIntConvertFromOctetString(par0, value, sizeof(value) , 1);
it works well,par0 is right;
### but when i want to set uint8_t value_second[] = { 0x06, 0xc7, 0x1c, 0xc5, 0x08, 0x5f, 0xab, 0x4f, 0xf7, 0xe0, 0x22, 0xc9, 0x1c, 0x45, 0x8a, 0xc2, 0x6f, 0x6f, 0x94, 0xe9, 0xdb, 0x7c, 0x8f, 0xa9, 0x0a, 0x13, 0x05, 0x8d, 0x83, 0xb2, 0x37, 0x96, 0x75, 0x00, 0x35, 0xc4, 0xe8, 0x78, 0xb1, 0x28, 0x76, 0xf8, 0xe5, 0x96, 0xfb, 0xd6, 0x4b, 0x9f, 0x61, 0x95, 0xbb, 0x5f, 0xf8, 0x37, 0x9c, 0xdd, 0xb7, 0xe7, 0xf8, 0x2f, 0xde, 0x11, 0x89, 0x4b, 0x15, 0xb4, 0xc4, 0xd5, 0x87, 0xa7, 0xa3, 0x46, 0xd0, 0xc6, 0x2c, 0xb3, 0x0f, 0x0f, 0x78, 0x71, 0xeb, 0xf7, 0xbc, 0x27, 0xd5, 0x93, 0x15, 0xb0, 0xe1, 0x93, 0xd3, 0x3c, 0xd0, 0x27, 0xc6, 0x42, 0x68, 0x46, 0x18, 0xb4, 0x35, 0xde, 0x39, 0x82, 0x07, 0xc4, 0xea, 0x08, 0x0d, 0x7c, 0x85, 0xd0, 0xc0, 0x05, 0xb3, 0x00, 0xdd, 0xbc, 0xe1, 0x4c, 0x64, 0x01, 0xc6, 0x06, 0xce, 0x2a, 0x45, 0x1e, 0xb5, 0x98, 0xcb, 0x3c, 0x98, 0x94, 0x6f, 0x50, 0xba, 0x26, 0x75, 0x3b, 0x6c, 0x24, 0x8b, 0x90, 0xe4, 0xab, 0x58, 0x2d, 0x03, 0xd8, 0x28, 0xd1, 0x47, 0x56, 0x1d, 0x48, 0x4f, 0x46, 0xd4, 0x18, 0x46, 0x3f, 0x5b, 0x67, 0x89, 0x82, 0x8a, 0x8a, 0x15, 0xd3, 0x31, 0x0e, 0x38, 0xe3, 0x8e, 0x39
};
TEE_BigInt par1 = (TEE_BigInt )TEE_Malloc(len, TEE_MALLOC_FILL_ZERO); TEE_BigIntInit(par1, num_u32); convert to TEE_Result result = TEE_BigIntConvertFromOctetString(par1, value_second, sizeof(value_second), 1);
_### it shows fail TEEResult: 0xffff300f
what can i do make it right ???