~ubuntu-branches/ubuntu/natty/libgcrypt11/natty-proposed

« back to all changes in this revision

Viewing changes to cipher/serpent.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2008-04-26 11:38:29 UTC
  • mto: (1.1.5 upstream) (2.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080426113829-1b2w4syxd8gzaj7d
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
#define byte_swap_32(x) \
60
60
  (0 \
61
61
   | (((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) \
62
 
   | (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24));
 
62
   | (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
63
63
 
64
64
/* These are the S-Boxes of Serpent.  They are copied from Serpents
65
65
   reference implementation (the optimized one, contained in
953
953
static const char *cipher_spec_serpent128_aliases[] =
954
954
  {
955
955
    "SERPENT",
956
 
    NULL,
 
956
    NULL
957
957
  };
958
958
 
959
959
gcry_cipher_spec_t _gcry_cipher_spec_serpent128 =
960
960
  {
961
961
    "SERPENT128", cipher_spec_serpent128_aliases, NULL, 16, 128,
962
962
    sizeof (serpent_context_t),
963
 
    serpent_setkey, serpent_encrypt, serpent_decrypt,
 
963
    serpent_setkey, serpent_encrypt, serpent_decrypt
964
964
  };
965
965
 
966
966
gcry_cipher_spec_t _gcry_cipher_spec_serpent192 =
967
967
  {
968
968
    "SERPENT192", NULL, NULL, 16, 192,
969
969
    sizeof (serpent_context_t),
970
 
    serpent_setkey, serpent_encrypt, serpent_decrypt,
 
970
    serpent_setkey, serpent_encrypt, serpent_decrypt
971
971
  };
972
972
 
973
973
gcry_cipher_spec_t _gcry_cipher_spec_serpent256 =
974
974
  {
975
975
    "SERPENT256", NULL, NULL, 16, 256,
976
976
    sizeof (serpent_context_t),
977
 
    serpent_setkey, serpent_encrypt, serpent_decrypt,
 
977
    serpent_setkey, serpent_encrypt, serpent_decrypt
978
978
  };