I study the KMIP in OASIS standard, I need some help. Integers, Enumerations, and Intervals in KMIP length shall be padded with four bytes. the reason for padding in kmip is need to match the right size??


The padding in KMIP is present only when data is converted to TTLV format, which is a binary representation of KMIP data. TTLV padding exists to "provide optimal alignment for both 32-bit and 64-bit processors" according to the kmip specification. It's generally easier for a CPU to load memory when it's aligned to certain byte widths, especially when the CPU is doing work in parallel.

see section 9 in the kmip 1.0 spec: https://docs.oasis-open.org/kmip/spec/v1.0/os/kmip-spec-1.0-os.html#_Toc262581260

wikipedia describes how "there can be substantial performance advantages from using aligned data" on x86 cpus: https://en.wikipedia.org/wiki/Data_structure_alignment

| improve this answer | |
  • $\begingroup$ Thank you for best answer to me. I also learn about the Data Structure Alignment for you. Thanks $\endgroup$ – 신동평 Mar 2 '17 at 5:22
  • $\begingroup$ Dear fafrd, Unfortunately I have a another Question. so.. Would it be possible for you provide me with your E-Mail? please.. Thanks. $\endgroup$ – 신동평 Mar 9 '17 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.