experiment
This commit is contained in:
parent
3063768ac2
commit
e219b86907
@ -43,6 +43,8 @@ void main()
|
||||
uint8_t UDSbuf[UDS_SIZE] = {0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25};
|
||||
uint8_t FWbuf[100] = {0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25,0Xe3,0xc5,0x58,0xaa,0x2f,0xd2,0x19,0x25};
|
||||
|
||||
|
||||
|
||||
mbedtls_sha256_ret( UDSbuf,UDS_SIZE,UDS_ID,0 );
|
||||
mbedtls_sha256_ret(FWbuf,100,FW_ID,0 );
|
||||
|
||||
@ -53,14 +55,26 @@ void main()
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
printf("%hhx", FW_ID[i]);
|
||||
printf(" : UDS ID\n" );
|
||||
printf(" : FW ID\n" );
|
||||
|
||||
|
||||
|
||||
mbedtls_sha256_context * sha_ctx;
|
||||
mbedtls_sha256_init(sha_ctx);
|
||||
|
||||
|
||||
mbedtls_sha256_starts_ret(sha_ctx,0);
|
||||
mbedtls_sha256_update_ret(sha_ctx, UDS_ID, 32);
|
||||
mbedtls_sha256_update_ret(sha_ctx, FW_ID, 32);
|
||||
mbedtls_sha256_finish_ret(sha_ctx,CD_ID);
|
||||
|
||||
mbedtls_sha256_free(sha_ctx);
|
||||
|
||||
for(int i = 0; i < 32; i++)
|
||||
printf("%hhx",CD_ID[i]);
|
||||
printf(" : CDI digest\n");
|
||||
|
||||
|
||||
printf("SUCCESSUL EXIT\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user