# Entropy

# Entropy

This module includes the platform abstraction for entropy generation.

## Summary

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/plat-entropy#group__plat-entropy_1ga863350e4f3c38d4b2c848e6be9642938(uint8_t *aOutput, uint16_t aOutputLength)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Fill buffer with entropy. |

## Functions

### otPlatEntropyGet

```
otError otPlatEntropyGet(
  uint8_t *aOutput,
  uint16_t aOutputLength
)
```
Fill buffer with entropy.

MUST be implemented using a true random number generator (TRNG).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aOutput` | A pointer to where the true random values are placed. Must not be NULL. | | `[in] aOutputLength` | Size of `aBuffer`. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully filled `aBuffer` with true random values. | | `OT_ERROR_FAILED` | Failed to fill `aBuffer` with true random values. | | `OT_ERROR_INVALID_ARGS` | `aBuffer` was set to NULL. | |

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).