Skip to content

fix(#2809): make Algorithm getters const#2817

Open
jalil-salame wants to merge 1 commit intobriansmith:mainfrom
jalil-salame:jalil/const-getters
Open

fix(#2809): make Algorithm getters const#2817
jalil-salame wants to merge 1 commit intobriansmith:mainfrom
jalil-salame:jalil/const-getters

Conversation

@jalil-salame
Copy link
Copy Markdown

This allows using the key_len in constants for type safety, e.g.

type CHACHA_KEY = [u8; ring::aead::CHACHA20_POLY1305.key_len()];

static DEFAULT_KEY: CHACHA_KEY = [0; ring::aead::CHACHA20_POLY1305.key_len()];

Closes #2809

This allows using the `key_len` in constants for type safety, e.g.

```rust
type CHACHA_KEY = [u8; ring::aead::CHACHA20_POLY1305.key_len()];

static DEFAULT_KEY: CHACHA_KEY = [0; ring::aead::CHACHA20_POLY1305.key_len()];
```

Closes briansmith#2809

Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constify accessor methods to the Algorithm struct

1 participant