Ignore:
Timestamp:
Jun 22, 2021, 9:00:19 PM (3 years ago)
Author:
coas-nagasima
Message:

WolfSSLとAzure IoT SDKを更新

Location:
azure_iot_hub_f767zi/trunk/wolfssl-4.7.0
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • azure_iot_hub_f767zi/trunk/wolfssl-4.7.0/wolfssl/wolfcrypt/chacha.h

    r457 r464  
    1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
    2020 */
     21/*
    2122
     23DESCRIPTION
     24This library contains implementation for the ChaCha20 stream cipher.
     25
     26*/
    2227/*!
    2328    \file wolfssl/wolfcrypt/chacha.h
     
    3641#endif
    3742
     43/*
     44Initialization vector starts at 13 with zero being the index origin of a matrix.
     45Block counter is located at index 12.
     46  0   1   2   3
     47  4   5   6   7
     48  8   9   10  11
     49  12  13  14  15
     50*/
     51#define CHACHA_MATRIX_CNT_IV 12
     52
    3853/* Size of the IV */
    3954#define CHACHA_IV_WORDS    3
    40 #define CHACHA_IV_BYTES    (CHACHA_IV_WORDS * sizeof(word32))
     55
     56/* Size of IV in bytes*/
     57#define CHACHA_IV_BYTES 12
     58#ifdef HAVE_XCHACHA
     59#define XCHACHA_NONCE_BYTES 24
     60#endif
    4161
    4262/* Size of ChaCha chunks */
     
    5878typedef struct ChaCha {
    5979    word32 X[CHACHA_CHUNK_WORDS];           /* state of cipher */
    60     word32 left;                            /* number of bytes leftover */
    6180#ifdef HAVE_INTEL_AVX1
    6281    /* vpshufd reads 16 bytes but we only use bottom 4. */
    6382    byte extra[12];
     83#endif
     84    word32 left;                            /* number of bytes leftover */
     85#if defined(USE_INTEL_CHACHA_SPEEDUP) || defined(WOLFSSL_ARMASM)
     86    word32 over[CHACHA_CHUNK_WORDS];
    6487#endif
    6588} ChaCha;
     
    7396WOLFSSL_API int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
    7497                              word32 msglen);
     98
     99WOLFSSL_LOCAL void wc_Chacha_purge_current_block(ChaCha* ctx);
     100
    75101WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);
     102
     103#ifdef HAVE_XCHACHA
     104WOLFSSL_API int wc_XChacha_SetKey(ChaCha *ctx, const byte *key, word32 keySz,
     105                                  const byte *nonce, word32 nonceSz,
     106                                  word32 counter);
     107#endif
    76108
    77109#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.