You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.9 KiB

  1. // Copyright (c) 2016 Andreas Auernhammer. All rights reserved.
  2. // Use of this source code is governed by a license that can be
  3. // found in the LICENSE file.
  4. package skein
  5. import "github.com/aead/skein/threefish"
  6. const (
  7. // The blocksize of Skein-512 in bytes.
  8. BlockSize = threefish.BlockSize512
  9. )
  10. // The different parameter types
  11. const (
  12. // CfgKey is the config type for the Key.
  13. CfgKey uint64 = 0
  14. // CfgConfig is the config type for the configuration.
  15. CfgConfig uint64 = 4
  16. // CfgPersonal is the config type for the personalization.
  17. CfgPersonal uint64 = 8
  18. // CfgPublicKey is the config type for the public key.
  19. CfgPublicKey uint64 = 12
  20. // CfgKeyID is the config type for the key id.
  21. CfgKeyID uint64 = 16
  22. // CfgNonce is the config type for the nonce.
  23. CfgNonce uint64 = 20
  24. // CfgMessage is the config type for the message.
  25. CfgMessage uint64 = 48
  26. // CfgOutput is the config type for the output.
  27. CfgOutput uint64 = 63
  28. // FirstBlock is the first block flag
  29. FirstBlock uint64 = 1 << 62
  30. // FinalBlock is the final block flag
  31. FinalBlock uint64 = 1 << 63
  32. // The skein schema ID = S H A 3 1 0 0 0
  33. SchemaID uint64 = 0x133414853
  34. )
  35. // Precomputed chain values for Skein-512
  36. var iv160 = [9]uint64{
  37. 0x28B81A2AE013BD91, 0xC2F11668B5BDF78F, 0x1760D8F3F6A56F12, 0x4FB747588239904F,
  38. 0x21EDE07F7EAF5056, 0xD908922E63ED70B8, 0xB8EC76FFECCB52FA, 0x01A47BB8A3F27A6E,
  39. 0,
  40. }
  41. var iv256 = [9]uint64{
  42. 0xCCD044A12FDB3E13, 0xE83590301A79A9EB, 0x55AEA0614F816E6F, 0x2A2767A4AE9B94DB,
  43. 0xEC06025E74DD7683, 0xE7A436CDC4746251, 0xC36FBAF9393AD185, 0x3EEDBA1833EDFC13,
  44. 0,
  45. }
  46. var iv384 = [9]uint64{
  47. 0xA3F6C6BF3A75EF5F, 0xB0FEF9CCFD84FAA4, 0x9D77DD663D770CFE, 0xD798CBF3B468FDDA,
  48. 0x1BC4A6668A0E4465, 0x7ED7D434E5807407, 0x548FC1ACD4EC44D6, 0x266E17546AA18FF8,
  49. 0,
  50. }
  51. var iv512 = [9]uint64{
  52. 0x4903ADFF749C51CE, 0x0D95DE399746DF03, 0x8FD1934127C79BCE, 0x9A255629FF352CB1,
  53. 0x5DB62599DF6CA7B0, 0xEABE394CA9D5C3F4, 0x991112C71A75B523, 0xAE18A40B660FCC33,
  54. 0,
  55. }