summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-01-29 14:47:57 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-01-29 14:47:57 +0000
commita65aa31183bbb0775fa2d760943510ce6a2a7d4e (patch)
treed3a708c5b9c0b3815a191bde14768f7c1fcba3e3
parentab0c14d096fc48df4091cedf83b4b1030770d899 (diff)
downloadkrb5-a65aa31183bbb0775fa2d760943510ce6a2a7d4e.tar.gz
krb5-a65aa31183bbb0775fa2d760943510ce6a2a7d4e.tar.xz
krb5-a65aa31183bbb0775fa2d760943510ce6a2a7d4e.zip
add roundup, encrypt_size, keyblock_size
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@175 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/include/krb5/encryption.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h
index 7ffb99133..1f0774ad7 100644
--- a/src/include/krb5/encryption.h
+++ b/src/include/krb5/encryption.h
@@ -98,4 +98,15 @@ typedef struct _krb5_checksum_entry {
#define ETYPE_IS_LOCAL(etype) (etype & 0x8000)
#define CKSUMTYPE_IS_LOCAL(cksumtype) (cksumtype & 0x8000)
+#ifndef krb5_roundup
+/* round x up to nearest multiple of y */
+#define krb5_roundup(x, y) ((((x) + (y) - 1)/(y))*(y))
+#endif /* roundup */
+
+/* macro function definitions to help clean up code */
+#define krb5_encrypt_size(length, crypto) \
+ krb5_roundup((length)+(crypto)->pad_minimum, (crypto)->block_length)
+
+#define krb5_keyblock_size(blockp) (sizeof(*blockp)+blockp->length-1)
+
#endif /* __KRB5_ENCRYPTION__ */