crypto.go 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. package s3_constants
  2. // Cryptographic constants
  3. const (
  4. // AES block and key sizes
  5. AESBlockSize = 16 // 128 bits for AES block size (IV length)
  6. AESKeySize = 32 // 256 bits for AES-256 keys
  7. // SSE algorithm identifiers
  8. SSEAlgorithmAES256 = "AES256"
  9. SSEAlgorithmKMS = "aws:kms"
  10. // SSE type identifiers for response headers and internal processing
  11. SSETypeC = "SSE-C"
  12. SSETypeKMS = "SSE-KMS"
  13. SSETypeS3 = "SSE-S3"
  14. // S3 multipart upload limits and offsets
  15. S3MaxPartSize = 5 * 1024 * 1024 * 1024 // 5GB - AWS S3 maximum part size limit
  16. // Multipart offset calculation for unique IV generation
  17. // Using 8GB offset between parts (larger than max part size) to prevent IV collisions
  18. // Critical for CTR mode encryption security in multipart uploads
  19. PartOffsetMultiplier = int64(1) << 33 // 8GB per part offset
  20. // KMS validation limits based on AWS KMS service constraints
  21. MaxKMSEncryptionContextPairs = 10 // Maximum number of encryption context key-value pairs
  22. MaxKMSKeyIDLength = 500 // Maximum length for KMS key identifiers
  23. // S3 multipart upload limits based on AWS S3 service constraints
  24. MaxS3MultipartParts = 10000 // Maximum number of parts in a multipart upload (1-10,000)
  25. )