Skip to content

zeroize: Add explicit array impls for DefaultIsZeroes#184

Merged
tony-iqlusion merged 1 commit intodevelopfrom
zeroize/explicit-array-impls
May 19, 2019
Merged

zeroize: Add explicit array impls for DefaultIsZeroes#184
tony-iqlusion merged 1 commit intodevelopfrom
zeroize/explicit-array-impls

Conversation

@tony-iqlusion
Copy link
Copy Markdown
Member

@tony-iqlusion tony-iqlusion commented May 19, 2019

When zeroing either [Z] or [Z; N], where Z: DefaultIsZeroes, i.e. a contiguous memory region we want to fill with Z::default() we can (at such a time it becomes available) take advantage of using an atomic memset-like implementation which can be implemented efficiently.

This change adds explicit bounds for arrays of up to size 64, and relaxes the IterMut bounds from DefaultIsZeroes to Zeroize, allowing it to be the fallback "slow mode" for dealing with cases where a fast path isn't available.

TODO: Const generics

When zeroing either [Z] or [Z; N], where `Z: DefaultIsZeroes`,
i.e. a contiguous memory region we want to fill with `Z::default()`
we can (at such a time it becomes available) take advantage of using
an atomic memset-like implementation which can be implemented
efficiently.

This change adds explicit bounds for arrays of up to size 64, and
relaxes the `IterMut` bounds from `DefaultIsZeroes` to `Zeroize`,
allowing it to be the fallback "slow mode" for dealing with cases
where a fast path isn't available.

TODO: Const generics
@tony-iqlusion tony-iqlusion merged commit 2a41d69 into develop May 19, 2019
@tony-iqlusion tony-iqlusion deleted the zeroize/explicit-array-impls branch May 19, 2019 21:32
@tony-iqlusion tony-iqlusion mentioned this pull request May 19, 2019
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.

1 participant