]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - providers/common/include/internal/ciphers/ciphercommon.h
Change provider params from int to size_t
[thirdparty/openssl.git] / providers / common / include / internal / ciphers / ciphercommon.h
index 38d03969022da93acae39e3630e9a06960cb037d..5593447264f492756e904442b44417f6ef245d04 100644 (file)
@@ -39,20 +39,20 @@ struct prov_cipher_ctx_st {
         ctr128_f ctr;
     } stream;
 
+    unsigned int mode;
+    size_t keylen;        /* key size (in bytes) */
+    size_t ivlen;
+    size_t blocksize;
+    size_t bufsz;         /* Number of bytes in buf */
+    unsigned int pad : 1; /* Whether padding should be used or not */
+    unsigned int enc : 1; /* Set to 1 for encrypt, or 0 otherwise */
+
     /*
      * num contains the number of bytes of |iv| which are valid for modes that
      * manage partial blocks themselves.
      */
-    size_t num;
-
-    int mode;
-    int enc;              /* Set to 1 for encrypt, or 0 otherwise */
-    size_t bufsz;         /* Number of bytes in buf */
-    size_t keylen;        /* key size (in bytes) */
-    size_t ivlen;
-    size_t blocksize;
+    unsigned int num;
     uint64_t flags;
-    unsigned int pad : 1; /* Whether padding should be used or not */
 
     /* Buffer of partial blocks processed via update calls */
     unsigned char buf[GENERIC_BLOCK_SIZE];
@@ -81,10 +81,11 @@ OSSL_OP_cipher_gettable_ctx_params_fn cipher_generic_gettable_ctx_params;
 OSSL_OP_cipher_settable_ctx_params_fn cipher_generic_settable_ctx_params;
 OSSL_OP_cipher_gettable_ctx_params_fn cipher_aead_gettable_ctx_params;
 OSSL_OP_cipher_settable_ctx_params_fn cipher_aead_settable_ctx_params;
-int cipher_generic_get_params(OSSL_PARAM params[], int md, unsigned long flags,
-                              int kbits, int blkbits, int ivbits);
+int cipher_generic_get_params(OSSL_PARAM params[], unsigned int md,
+                              unsigned long flags,
+                              size_t kbits, size_t blkbits, size_t ivbits);
 void cipher_generic_initkey(void *vctx, size_t kbits, size_t blkbits,
-                            size_t ivbits, int mode,
+                            size_t ivbits, unsigned int mode,
                             const PROV_CIPHER_HW *hw, void *provctx);
 
 #define IMPLEMENT_generic_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits,     \