Mbed OS Reference
Loading...
Searching...
No Matches
nist_kw.h File Reference

This file provides an API for key wrapping (KW) and key wrapping with padding (KWP) as defined in NIST SP 800-38F. More...

#include "mbedtls/config.h"
#include "mbedtls/cipher.h"

Go to the source code of this file.

Data Structures

struct  mbedtls_nist_kw_context
 The key wrapping context-type definition. More...
 

Functions

void mbedtls_nist_kw_init (mbedtls_nist_kw_context *ctx)
 This function initializes the specified key wrapping context to make references valid and prepare the context for mbedtls_nist_kw_setkey() or mbedtls_nist_kw_free(). More...
 
int mbedtls_nist_kw_setkey (mbedtls_nist_kw_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits, const int is_wrap)
 This function initializes the key wrapping context set in the ctx parameter and sets the encryption key. More...
 
void mbedtls_nist_kw_free (mbedtls_nist_kw_context *ctx)
 This function releases and clears the specified key wrapping context and underlying cipher sub-context. More...
 
int mbedtls_nist_kw_wrap (mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, const unsigned char *input, size_t in_len, unsigned char *output, size_t *out_len, size_t out_size)
 This function encrypts a buffer using key wrapping. More...
 
int mbedtls_nist_kw_unwrap (mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, const unsigned char *input, size_t in_len, unsigned char *output, size_t *out_len, size_t out_size)
 This function decrypts a buffer using key wrapping. More...
 

Detailed Description

This file provides an API for key wrapping (KW) and key wrapping with padding (KWP) as defined in NIST SP 800-38F.

https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf

Key wrapping specifies a deterministic authenticated-encryption mode of operation, according to NIST SP 800-38F: Recommendation for Block Cipher Modes of Operation: Methods for Key Wrapping. Its purpose is to protect cryptographic keys.

Its equivalent is RFC 3394 for KW, and RFC 5649 for KWP. https://tools.ietf.org/html/rfc3394 https://tools.ietf.org/html/rfc5649

Definition in file nist_kw.h.