add roundup, encrypt_size, keyblock_size
authorJohn Kohl <jtkohl@mit.edu>
Mon, 29 Jan 1990 14:47:57 +0000 (14:47 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 29 Jan 1990 14:47:57 +0000 (14:47 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@175 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/encryption.h

index 7ffb99133390132e6c51098e3a8b09365fbd9c1e..1f0774ad7348e4901309b59fb8267e82fbe6ae0b 100644 (file)
@@ -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__ */