Add CFB1 and CFB8 chaining modes. 68/69468/6
authorDariusz Michaluk <d.michaluk@samsung.com>
Thu, 12 May 2016 15:24:26 +0000 (17:24 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Thu, 19 May 2016 07:14:11 +0000 (09:14 +0200)
Change-Id: Ia464613fd38ec14f3d32905966eefe7ead430444

api/yaca/types.h
src/encrypt.c

index 282d007..d025a15 100644 (file)
@@ -138,6 +138,8 @@ typedef enum {
         * #YACA_BCM_CBC,
         * #YACA_BCM_OFB,
         * #YACA_BCM_CFB,
+        * #YACA_BCM_CFB1,
+        * #YACA_BCM_CFB8,
         * #YACA_BCM_ECB,
         * #YACA_BCM_GCM,
         * #YACA_BCM_CCM,
@@ -154,6 +156,8 @@ typedef enum {
         * #YACA_BCM_CBC,
         * #YACA_BCM_OFB,
         * #YACA_BCM_CFB,
+        * #YACA_BCM_CFB1,
+        * #YACA_BCM_CFB8,
         * #YACA_BCM_ECB
         * - see #yaca_block_cipher_mode_e for details on additional parameters (mandatory).
         */
@@ -180,6 +184,8 @@ typedef enum {
         * #YACA_BCM_CBC,
         * #YACA_BCM_OFB,
         * #YACA_BCM_CFB,
+        * #YACA_BCM_CFB1,
+        * #YACA_BCM_CFB8,
         * #YACA_BCM_ECB
         * - see #yaca_block_cipher_mode_e for details on additional parameters (mandatory).
         * - Use triple DES keys to perform corresponding 3-key 3DES encryption.
@@ -268,12 +274,24 @@ typedef enum {
        YACA_BCM_GCM,
 
        /**
-        * CFB block cipher mode.
+        * Default CFB block cipher mode.
         * 16-byte initialization vector is mandatory.
         */
        YACA_BCM_CFB,
 
        /**
+        * 1 bit CFB block cipher mode.
+        * 16-byte initialization vector is mandatory.
+        */
+       YACA_BCM_CFB1,
+
+       /**
+        * 8 bits CFB block cipher mode.
+        * 16-byte initialization vector is mandatory.
+        */
+       YACA_BCM_CFB8,
+
+       /**
         * OFB block cipher mode.
         * 16-byte initialization vector is mandatory.
         */
index a4516c3..784ac35 100644 (file)
@@ -135,6 +135,10 @@ static const char *bcm_to_str(yaca_block_cipher_mode_e bcm)
                return "gcm";
        case YACA_BCM_CFB:
                return "cfb";
+       case YACA_BCM_CFB1:
+               return "cfb1";
+       case YACA_BCM_CFB8:
+               return "cfb8";
        case YACA_BCM_OFB:
                return "ofb";
        case YACA_BCM_OCB: