This commit is contained in:
zzz
2013-02-09 19:28:12 +00:00
parent e4318e95a5
commit 7f5d6ca1c7
3 changed files with 21 additions and 6 deletions

View File

@@ -461,6 +461,8 @@ public class ElGamalAESEngine {
* No new session key
* No current tag (encrypt as new session)
*
* @param tagsForDelivery session tags to be associated with the key or null;
* 200 max enforced at receiver
* @deprecated unused
*/
public byte[] encrypt(byte data[], PublicKey target, SessionKey key, Set tagsForDelivery, long paddedSize) {
@@ -498,6 +500,8 @@ public class ElGamalAESEngine {
* - random bytes, padding the total size to greater than paddedSize with a mod 16 = 0
* </pre>
*
* @param tagsForDelivery session tags to be associated with the key or null;
* 200 max enforced at receiver
*/
private byte[] encryptNewSession(byte data[], PublicKey target, SessionKey key, Set tagsForDelivery,
SessionKey newKey, long paddedSize) {
@@ -564,6 +568,8 @@ public class ElGamalAESEngine {
* - random bytes, padding the total size to greater than paddedSize with a mod 16 = 0
* </pre>
*
* @param tagsForDelivery session tags to be associated with the key or null;
* 200 max enforced at receiver
*/
private byte[] encryptExistingSession(byte data[], PublicKey target, SessionKey key, Set tagsForDelivery,
SessionTag currentTag, SessionKey newKey, long paddedSize) {
@@ -619,12 +625,20 @@ public class ElGamalAESEngine {
* </pre>
*
* Note: package private for ElGamalTest.testAES()
*
* @param tagsForDelivery session tags to be associated with the key or null;
* 200 max enforced at receiver
*/
final byte[] encryptAESBlock(byte data[], SessionKey key, byte[] iv, Set tagsForDelivery, SessionKey newKey,
long paddedSize) {
return encryptAESBlock(data, key, iv, tagsForDelivery, newKey, paddedSize, 0);
}
/**
*
* @param tagsForDelivery session tags to be associated with the key or null;
* 200 max enforced at receiver
*/
private final byte[] encryptAESBlock(byte data[], SessionKey key, byte[] iv, Set tagsForDelivery, SessionKey newKey,
long paddedSize, int prefixBytes) {
//_log.debug("iv for encryption: " + DataHelper.toString(iv, 16));

View File

@@ -393,7 +393,8 @@ public class DataHelper {
* A more efficient Properties.load
*
* Some of the other differences:
* - This does not process or drop backslashes
* - UTF-8 encoding, not ISO-8859-1
* - No escaping! This does not process or drop backslashes
* - '#' or ';' starts a comment line, but '!' does not
* - Leading whitespace is not trimmed
* - '=' is the only key-termination character (not ':' or whitespace)

View File

@@ -172,17 +172,17 @@ public class GarlicMessageBuilder {
/**
* used by TestJob and directly above
* and for encrypting DatabaseLookupMessages
*
* @param ctx scope
* @param config how/what to wrap
* @param wrappedKey unused - why??
* @param wrappedTags Output parameter that will be filled with the sessionTags used.
If non-empty on return you must call skm.tagsDelivered() when sent
and then call skm.tagsAcked() or skm.failTags() later.
* @param wrappedTags New tags to be sent along with the message.
* 200 max enforced at receiver; null OK
* @param target public key of the location being garlic routed to (may be null if we
* know the encryptKey and encryptTag)
* @param encryptKey sessionKey used to encrypt the current message
* @param encryptTag sessionTag used to encrypt the current message
* @param encryptKey sessionKey used to encrypt the current message, non-null
* @param encryptTag sessionTag used to encrypt the current message, null to force ElG
* @throws IllegalArgumentException on error
*/
public static GarlicMessage buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags,