I am using cryptographic hardware accelerator of am335x. As per documentation it unloads the cryptographic operations from the main CPU and hence increases the performance. But from the security point of view how is it useful. In the documentation of 'self encrypted disks'(SED) it is given that the encryption key can not be accessed outside the dedicated processing chip. Hence any malware can not access the keys from RAM. Is it true in the case of am335x? Or are those keys stored in RAM?
Simple hardware crypto accelerators have no security benefits, only performance ones (we could argue that this allows for larger key sizes thus increased security).
Hardware security module, on the other hand are similar devices but in addition they can also store the keys securely and never reveal them to the computer itself; when the HSM is set up the keys are either imported into it or generated on it directly and they have no way of leaving the module later (the only way to get the keys out would be physical access, and even then they're tamper-proof).
The computer just gives it the plaintext, instructions on what to do with it, and the module spits out ciphertext.
About the AM335x, in the datasheet of the AM3352, there is the following :
Crypto Hardware Accelerators (AES, SHA, PKA, RNG)
So it can do AES, SHA in hardware (not sure what PKA stands for), as well as generate cryptographically-secure random numbers. There is no mention of key management however, so the keys will still be stored on the computer itself and the security of those keys can't be compared to an HSM for example.