From: Dariusz Michaluk Date: Thu, 12 May 2016 15:24:26 +0000 (+0200) Subject: Add CFB1 and CFB8 chaining modes. X-Git-Tag: accepted/tizen/common/20160810.161523~143 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c1494615b5825062ded2f289fef36577eeb59be;p=platform%2Fcore%2Fsecurity%2Fyaca.git Add CFB1 and CFB8 chaining modes. Change-Id: Ia464613fd38ec14f3d32905966eefe7ead430444 --- diff --git a/api/yaca/types.h b/api/yaca/types.h index 282d007..d025a15 100644 --- a/api/yaca/types.h +++ b/api/yaca/types.h @@ -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. */ diff --git a/src/encrypt.c b/src/encrypt.c index a4516c3..784ac35 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -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: