CryptoSys API Library Manual

Aead.InitKey Method

Initializes the context with the key and algorithm ready for repeated incremental operations

Syntax

[C#]
public int InitKey(
	byte[] key,
	Aead.Algorithm alg
)
[VB.NET]
Public Function InitKey ( _
	key As Byte(), _
	alg As Aead.Algorithm _
) As Integer

Parameters

key
Key of exact length for given algorithm (16 or 32 bytes).
alg
Type: Aead.Algorithm
AEAD algorithm to use

Return Value

Zero (0) if successful; otherwise it returns a nonzero error code

Remarks

Must be followed by SetNonce(). Can be called at any time to cancel any previous incremental settings.

Example

[C#]
Aead o = Aead.Instance();
o.InitKey(key, alg);
o.SetNonce(nonce);
//...
o.Dispose();

See Also

VB6/C equivalent: AEAD_InitKey

[Contents] [Index]

[PREV: Aead.FinishEncrypt Method...]   [Contents]   [Index]   
   [NEXT: Aead.Instance Method...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.