Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 8cde69a
  • /
  • providers
  • /
  • implementations
  • /
  • ciphers
  • /
  • cipher_aes_ocb.h
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:94d8183167c2577ddac0a2f1beebd9caac922b78
directory badge Iframe embedding
swh:1:dir:46a59909efc70b634aed344873f364ee29b0b783
cipher_aes_ocb.h
/*
 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"

#define OCB_MAX_TAG_LEN     AES_BLOCK_SIZE
#define OCB_MAX_DATA_LEN    AES_BLOCK_SIZE
#define OCB_MAX_AAD_LEN     AES_BLOCK_SIZE

typedef struct prov_aes_ocb_ctx_st {
    PROV_CIPHER_CTX base;       /* Must be first */
    union {
        OSSL_UNION_ALIGN;
        AES_KEY ks;
    } ksenc;                    /* AES key schedule to use for encryption/aad */
    union {
        OSSL_UNION_ALIGN;
        AES_KEY ks;
    } ksdec;                    /* AES key schedule to use for decryption */
    OCB128_CONTEXT ocb;
    unsigned int iv_state;      /* set to one of IV_STATE_XXX */
    unsigned int key_set : 1;
    size_t taglen;
    size_t data_buf_len;
    size_t aad_buf_len;
    unsigned char tag[OCB_MAX_TAG_LEN];
    unsigned char data_buf[OCB_MAX_DATA_LEN]; /* Store partial data blocks */
    unsigned char aad_buf[OCB_MAX_AAD_LEN];   /* Store partial AAD blocks */
} PROV_AES_OCB_CTX;

const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ocb(size_t keybits);

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top