Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs SecureMemory.Slice

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module juptune.crypto.memory;

struct Slice(
    T
)
{
    /++ FUNCTIONS ++/
    
    ///
    T[] memory();
    ///
    bool mustBeContiguous( other);
    ///
    bool mustNotOverlap( other);
    ///
     opSlice(size_t _)(size_t start, size_t end);
    ///
     reinterpret(NewT)();
    ///
    const  reinterpret(NewT)();
    
    /++ VARIABLES ++/
    
    ///
    T[] _memory;
}

Documentation

A loose wrapper around a T[]that originates from a SecureMemorystruct.

Use this type when you want random length slices, but only from hardened memory.

Notes

A rarity for Juptune - this struct is copyable as there just isn't really a clean way to enforce that it's not copied outside of the SecureMemorystruct's lifetime without it getting in the way.

In case it's not clear. $(B This slice must not outlive the SecureMemorystruct it came from).

Safeguards

The slice can never be accessed when its unerlying slice is null.

If you're slicing up a bunch of memory, please use mustNotOverlapand mustBeContiguousto help ensure you've sliced things correctly.

Functions

Name Description
memory
mustBeContiguous
mustNotOverlap
opSlice
reinterpret
reinterpret

Variables

Name Description
_memory