diff options
| author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-09-06 17:20:33 +0200 |
|---|---|---|
| committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-09-06 17:26:58 +0200 |
| commit | e6177630198eb1eea2def0374fae1196da0e40ec (patch) | |
| tree | 704951804609999fb6ef7a956b04921b9f84c320 /libtomcrypt/hashes/hash_get_oid.c | |
| parent | 943f9ab50c110133a5cd1118b5b19cb09301168f (diff) | |
| download | cryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.tar.gz cryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.tar.xz cryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.zip | |
Run Lindent on libtom(*)
Diffstat (limited to 'libtomcrypt/hashes/hash_get_oid.c')
| -rw-r--r-- | libtomcrypt/hashes/hash_get_oid.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/libtomcrypt/hashes/hash_get_oid.c b/libtomcrypt/hashes/hash_get_oid.c index 39f4372..835ffb1 100644 --- a/libtomcrypt/hashes/hash_get_oid.c +++ b/libtomcrypt/hashes/hash_get_oid.c @@ -17,60 +17,60 @@ */ static const oid_st sha1_oid = { - .OIDlen = 6, - .OID = { 1, 3, 14, 3, 2, 26 }, + .OIDlen = 6, + .OID = {1, 3, 14, 3, 2, 26}, }; static const oid_st md5_oid = { - .OIDlen = 6, - .OID = { 1, 2, 840, 113549, 2, 5, }, + .OIDlen = 6, + .OID = {1, 2, 840, 113549, 2, 5,}, }; static const oid_st sha224_oid = { - .OIDlen = 9, - .OID = { 2, 16, 840, 1, 101, 3, 4, 2, 4, }, + .OIDlen = 9, + .OID = {2, 16, 840, 1, 101, 3, 4, 2, 4,}, }; static const oid_st sha256_oid = { - .OIDlen = 9, - .OID = { 2, 16, 840, 1, 101, 3, 4, 2, 1, }, + .OIDlen = 9, + .OID = {2, 16, 840, 1, 101, 3, 4, 2, 1,}, }; static const oid_st sha384_oid = { - .OIDlen = 9, - .OID = { 2, 16, 840, 1, 101, 3, 4, 2, 2, }, + .OIDlen = 9, + .OID = {2, 16, 840, 1, 101, 3, 4, 2, 2,}, }; static const oid_st sha512_oid = { - .OIDlen = 9, - .OID = { 2, 16, 840, 1, 101, 3, 4, 2, 3, }, + .OIDlen = 9, + .OID = {2, 16, 840, 1, 101, 3, 4, 2, 3,}, }; -int hash_get_oid(const struct algo_properties_st *hash, oid_st *st) +int hash_get_oid(const struct algo_properties_st *hash, oid_st * st) { - switch (hash->algo) { - case NCR_ALG_SHA1: - memcpy(st, &sha1_oid, sizeof(*st)); - break; - case NCR_ALG_MD5: - memcpy(st, &md5_oid, sizeof(*st)); - break; - case NCR_ALG_SHA2_224: - memcpy(st, &sha224_oid, sizeof(*st)); - break; - case NCR_ALG_SHA2_256: - memcpy(st, &sha256_oid, sizeof(*st)); - break; - case NCR_ALG_SHA2_384: - memcpy(st, &sha384_oid, sizeof(*st)); - break; - case NCR_ALG_SHA2_512: - memcpy(st, &sha512_oid, sizeof(*st)); - break; - default: - return CRYPT_INVALID_ARG; - } - return CRYPT_OK; + switch (hash->algo) { + case NCR_ALG_SHA1: + memcpy(st, &sha1_oid, sizeof(*st)); + break; + case NCR_ALG_MD5: + memcpy(st, &md5_oid, sizeof(*st)); + break; + case NCR_ALG_SHA2_224: + memcpy(st, &sha224_oid, sizeof(*st)); + break; + case NCR_ALG_SHA2_256: + memcpy(st, &sha256_oid, sizeof(*st)); + break; + case NCR_ALG_SHA2_384: + memcpy(st, &sha384_oid, sizeof(*st)); + break; + case NCR_ALG_SHA2_512: + memcpy(st, &sha512_oid, sizeof(*st)); + break; + default: + return CRYPT_INVALID_ARG; + } + return CRYPT_OK; } /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c,v $ */ |
