xof: Add identifiers for MGF1 XOFs based on SHA-224/384
authorTobias Brunner <tobias@strongswan.org>
Mon, 25 Sep 2017 16:15:35 +0000 (18:15 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Nov 2017 15:48:10 +0000 (16:48 +0100)
src/libstrongswan/crypto/xofs/xof.c
src/libstrongswan/crypto/xofs/xof.h

index 7915985..2b866ae 100644 (file)
@@ -19,7 +19,9 @@
 ENUM(ext_out_function_names, XOF_UNDEFINED, XOF_CHACHA20,
        "XOF_UNDEFINED",
        "XOF_MGF1_SHA1",
+       "XOF_MGF1_SHA224",
        "XOF_MGF1_SHA256",
+       "XOF_MGF1_SHA384",
        "XOF_MGF1_SHA512",
        "XOF_SHAKE128",
        "XOF_SHAKE256",
@@ -35,12 +37,14 @@ ext_out_function_t xof_mgf1_from_hash_algorithm(hash_algorithm_t alg)
        {
                case HASH_SHA1:
                        return XOF_MGF1_SHA1;
+               case HASH_SHA224:
+                       return XOF_MGF1_SHA224;
                case HASH_SHA256:
                        return XOF_MGF1_SHA256;
+               case HASH_SHA384:
+                       return XOF_MGF1_SHA384;
                case HASH_SHA512:
                        return XOF_MGF1_SHA512;
-               case HASH_SHA224:
-               case HASH_SHA384:
                case HASH_IDENTITY:
                case HASH_UNKNOWN:
                case HASH_MD2:
index 83c9ab8..934a1ee 100644 (file)
@@ -32,11 +32,15 @@ typedef struct xof_t xof_t;
  */
 enum ext_out_function_t {
        XOF_UNDEFINED,
-       /** RFC 2437 PKCS#1 */
+       /** RFC 8017 PKCS#1 */
        XOF_MGF1_SHA1,
-       /** RFC 2437 PKCS#1 */
+       /** RFC 8017 PKCS#1 */
+       XOF_MGF1_SHA224,
+       /** RFC 8017 PKCS#1 */
        XOF_MGF1_SHA256,
-       /** RFC 2437 PKCS#1 */
+       /** RFC 8017 PKCS#1 */
+       XOF_MGF1_SHA384,
+       /** RFC 8017 PKCS#1 */
        XOF_MGF1_SHA512,
        /** FIPS 202 */
        XOF_SHAKE_128,