src/pEp_internal.h
branchENGINE-633
changeset 4079 da3b0627a59c
parent 4065 7f0cf93bc2af
     1.1 --- a/src/pEp_internal.h	Sun Sep 22 15:02:37 2019 +0200
     1.2 +++ b/src/pEp_internal.h	Sun Sep 22 21:41:35 2019 +0200
     1.3 @@ -573,3 +573,38 @@
     1.4      } while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
     1.5      return rc;
     1.6  }
     1.7 +
     1.8 +static inline const char* get_micalg_string(PEP_HASH_ALGO micalg) {
     1.9 +    switch (micalg) {
    1.10 +        case MD5:
    1.11 +            return "pgp-md5";
    1.12 +        case SHA1:    
    1.13 +            return "pgp-sha1";
    1.14 +        case RMD160:
    1.15 +            return "pgp-ripemd160";
    1.16 +        case MD2:    
    1.17 +            return "pgp-md2";
    1.18 +        case TIGER:    
    1.19 +            return "pgp-tiger192";
    1.20 +        case HAVAL:    
    1.21 +            return "pgp-haval";
    1.22 +        case SHA256:    
    1.23 +            return "pgp-sha256";
    1.24 +        case SHA384:    
    1.25 +            return "pgp-sha384";
    1.26 +        case SHA512:    
    1.27 +            return "pgp-sha512";
    1.28 +        case SHA224:    
    1.29 +            return "pgp-sha224";
    1.30 +        case MD4:                
    1.31 +            return "pgp-md4";
    1.32 +        case CRC32:    
    1.33 +            return "pgp-crc32";
    1.34 +        case CRC32_RFC1510:    
    1.35 +            return "pgp-crc32rfc1510";
    1.36 +        case CRC32_RFC2440:    
    1.37 +            return "pgp-crc24rfc2440";
    1.38 +        default:
    1.39 +            return NULL;
    1.40 +    }
    1.41 +}