Przeglądaj źródła

comment updates

Jonathan Turner 9 lat temu
rodzic
commit
c467c01ced

+ 11 - 0
crypto/engine/engine.go

@@ -10,10 +10,15 @@ import (
 )
 
 // RFC 3961: DR(Key, Constant) = k-truncate(E(Key, Constant, initial-cipher-state)).
+//
 // key: base key or protocol key. Likely to be a key from a keytab file.
+//
 // usage: a constant.
+//
 // n: block size in bits (not bytes) - note if you use something like aes.BlockSize this is in bytes.
+//
 // k: key length / key seed length in bits. Eg. for AES256 this value is 256.
+//
 // e: the encryption etype function to use.
 func DeriveRandom(key, usage []byte, n, k int, e etype.EType) ([]byte, error) {
 	//Ensure the usage constant is at least the size of the cypher block size. Pass it through the nfold algorithm that will "stretch" it if needs be.
@@ -145,21 +150,27 @@ func VerifyChecksum(key, chksum, msg []byte, usage uint32, etype etype.EType) bo
 }
 
 // Get the checksum key usage value for the usage number un.
+//
 // RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below.
+//
 // Kc = DK(base-key, usage | 0x99);
 func GetUsageKc(un uint32) []byte {
 	return getUsage(un, 0x99)
 }
 
 // Get the encryption key usage value for the usage number un
+//
 // RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below.
+//
 // Ke = DK(base-key, usage | 0xAA);
 func GetUsageKe(un uint32) []byte {
 	return getUsage(un, 0xAA)
 }
 
 // Get the integrity key usage value for the usage number un
+//
 // RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below.
+//
 // Ki = DK(base-key, usage | 0x55);
 func GetUsageKi(un uint32) []byte {
 	return getUsage(un, 0x55)

+ 1 - 0
crypto/engine/nfold.go

@@ -35,6 +35,7 @@ License: http://www.apache.org/licenses/LICENSE-2.0
 */
 
 // RFC 3961: n-fold algorithm.
+//
 // m input bytes that will be "stretched" to the least common multiple of n bits and the bit length of m.
 func Nfold(m []byte, n int) []byte {
 	k := len(m) * 8

+ 1 - 0
crypto/etype/etype.go

@@ -2,6 +2,7 @@ package etype
 
 import "hash"
 
+// Interface defining the Encryption Algorithm Profile from RFC 3961.
 type EType interface {
 	GetETypeID() int
 	GetHashID() int

+ 1 - 0
iana/adtype/constants.go

@@ -1,3 +1,4 @@
+// Authenticator type assigned numbers.
 package adtype
 
 const (

+ 1 - 0
iana/asnAppTag/constants.go

@@ -1,3 +1,4 @@
+// ASN1 application tag numbers.
 package asnAppTag
 
 const (

+ 1 - 0
iana/chksumtype/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 checksum type assigned numbers.
 package chksumtype
 
 const (

+ 1 - 0
iana/errorcode/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 assigned error codes.
 package errorcode
 
 import "fmt"

+ 1 - 0
iana/etypeID/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 encryption type assigned numbers.
 package etypeID
 
 const (

+ 1 - 0
iana/keyusage/constants.go

@@ -1,3 +1,4 @@
+// Key usage assigned numbers.
 package keyusage
 
 const (

+ 1 - 0
iana/msgtype/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 message type assigned numbers.
 package msgtype
 
 const (

+ 1 - 0
iana/nametype/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 principal name type numbers.
 package nametype
 
 const (

+ 1 - 0
iana/patype/constants.go

@@ -1,3 +1,4 @@
+// Kerberos 5 pre-authentication type assigned numbers.
 package patype
 
 const (