@@ -331,7 +331,7 @@ func main() {
331
331
// The method code must be defined for the class of the destination function, and
332
332
// indicates particular methods to be invoked in the processing of this message
333
333
eudCmpPtn .AddEdge (decryptOutFunc .Label , processFunc .Label , "plaintext" , "processOp" , & epCPInit .Msgs )
334
- eudCmpPtn .AddEdge (processFunc .Label , encryptRtnFunc .Label , "plaintext" , "processOp " , & epCPInit .Msgs )
334
+ eudCmpPtn .AddEdge (processFunc .Label , encryptRtnFunc .Label , "plaintext" , "encryptOp " , & epCPInit .Msgs )
335
335
336
336
// each of the CmpPtn's functions gets a cfg dictionary whose structure is defined
337
337
// by the function's class. Here we create and populate those structures, which
@@ -347,7 +347,7 @@ func main() {
347
347
// We will later check this validity as it depends also on the mapping of functions to processors
348
348
// that has not yet been specified.
349
349
350
- decryptOutStr := createCryptoPcktCfg ("decrypt" , cryptoAlg , keyLength , "plaintext" )
350
+ decryptOutStr := createCryptoPcktCfg ("decrypt" , cryptoAlg , keyLength , "plaintext" , false )
351
351
epCPInit .AddCfg (eudCmpPtn , decryptOutFunc , decryptOutStr )
352
352
353
353
// the 'processFunc' function in an EUD CmpPtn models the computational delay of doing something
@@ -357,13 +357,13 @@ func main() {
357
357
tlb := map [string ]string {"processOp" :"finish" }
358
358
tcp := map [string ]string {"processOp" : encryptPerf .Name }
359
359
360
- processStr := createProcessPcktCfg (rtd , tcd , tcp , tlb )
360
+ processStr := createProcessPcktCfg (rtd , tcd , tcp , tlb , false )
361
361
362
362
epCPInit .AddCfg (eudCmpPtn , processFunc , processStr )
363
363
364
364
// the 'encryptRtn' function in an EUD CmpPtn models the delay of encrypting
365
365
// a response to the message sent to the EUD
366
- encryptRtnStr := createCryptoPcktCfg ("encrypt" , cryptoAlg , keyLength , "encryptext" )
366
+ encryptRtnStr := createCryptoPcktCfg ("encrypt" , cryptoAlg , keyLength , "encryptext" , false )
367
367
epCPInit .AddCfg (eudCmpPtn , encryptRtnFunc , encryptRtnStr )
368
368
369
369
// The overall model creates a CmpPtn for each EUD, named
@@ -396,9 +396,9 @@ func main() {
396
396
// an external edge from encryptOut to the EUD. Note that a different method (AddExtEdge)
397
397
// is used to specify the cross-CmpPtn connections
398
398
cpyCP .AddExtEdge (cpyCP .Name , encryptPerf .Name , encryptRtnFunc .Label , decryptRtnFunc .Label ,
399
- "encryptext" , "processOp " , & epCPInit .Msgs , & epCPSrcInit .Msgs )
399
+ "encryptext" , "decryptOp " , & epCPInit .Msgs , & epCPSrcInit .Msgs )
400
400
encryptPerf .AddExtEdge (encryptPerf .Name , cpyCP .Name , encryptOutFunc .Label , decryptOutFunc .Label ,
401
- "encryptext" , "processOp " , & epCPSrcInit .Msgs , & epCPInit .Msgs )
401
+ "encryptext" , "decryptOp " , & epCPSrcInit .Msgs , & epCPInit .Msgs )
402
402
403
403
// save the EUD CmpPtn in the output dictionary
404
404
cpDict .AddCompPattern (cpyCP )
@@ -416,7 +416,7 @@ func main() {
416
416
417
417
// add edges to the packet source CmpPtn
418
418
encryptPerf .AddEdge (srcFunc .Label , srcFunc .Label , "initiate" , "generateOp" , & epCPSrcInit .Msgs )
419
- encryptPerf .AddEdge (srcFunc .Label , encryptOutFunc .Label , "plaintext" , "processOp " , & epCPSrcInit .Msgs )
419
+ encryptPerf .AddEdge (srcFunc .Label , encryptOutFunc .Label , "plaintext" , "encryptOp " , & epCPSrcInit .Msgs )
420
420
encryptPerf .AddEdge (decryptRtnFunc .Label , srcFunc .Label , "finishtext" , "completeOp" , & epCPSrcInit .Msgs )
421
421
encryptPerf .AddEdge (srcFunc .Label , finishFunc .Label , "finishtext" , "finishOp" , & epCPSrcInit .Msgs )
422
422
@@ -425,7 +425,7 @@ func main() {
425
425
srcCfg := pces .ClassCreateCycleDstCfg ()
426
426
427
427
// create the routing and timing code maps
428
- rtd = map [string ]string {"generateOp" :"plaintext" , "completeOp" :"finishtext" }
428
+ rtd = map [string ]string {"generateOp" :"plaintext" , "completeOp" : "finishtext" }
429
429
tcd = map [string ]string {"generateOp" :"generateOp" , "completeOp" : "completeOp" }
430
430
431
431
// build out the cfg dictionary for the srcFunc
@@ -441,11 +441,11 @@ func main() {
441
441
epCPSrcInit .AddCfg (encryptPerf , srcFunc , serialSrcCfg )
442
442
443
443
// put in parameters for encryptOutFunc
444
- encryptOutStr := createCryptoPcktCfg ("encrypt" , cryptoAlg , keyLength , "encryptext" )
444
+ encryptOutStr := createCryptoPcktCfg ("encrypt" , cryptoAlg , keyLength , "encryptext" , archType == "SSL" )
445
445
epCPSrcInit .AddCfg (encryptPerf , encryptOutFunc , encryptOutStr )
446
446
447
447
// put in parameters for decryptRtnFunc
448
- decryptRtnStr := createCryptoPcktCfg ("decrypt" , cryptoAlg , keyLength , "finishtext" )
448
+ decryptRtnStr := createCryptoPcktCfg ("decrypt" , cryptoAlg , keyLength , "finishtext" , archType == "SSL" )
449
449
epCPSrcInit .AddCfg (encryptPerf , decryptRtnFunc , decryptRtnStr )
450
450
451
451
// make a minimalistic cfg for finish
@@ -745,7 +745,7 @@ func main() {
745
745
746
746
}
747
747
748
- func createProcessPcktCfg (rt , tc , tcp , tlb map [string ]string ) string {
748
+ func createProcessPcktCfg (rt , tc , tcp , tlb map [string ]string , accl bool ) string {
749
749
cfg := pces .ClassCreateProcessPcktCfg ()
750
750
751
751
for key , value := range rt {
@@ -764,6 +764,8 @@ func createProcessPcktCfg(rt, tc, tcp, tlb map[string]string) string {
764
764
cfg .TgtLabel [key ] = value
765
765
}
766
766
767
+ cfg .Accl = accl
768
+
767
769
// serialize the class-dependent cfg structure
768
770
serialCfg , err0 := cfg .Serialize (useYAML )
769
771
if err0 != nil {
@@ -773,13 +775,13 @@ func createProcessPcktCfg(rt, tc, tcp, tlb map[string]string) string {
773
775
}
774
776
775
777
// def createCryptoPckt("decrypt", cryptoAlg, keyLength, false)
776
- func createCryptoPcktCfg (cryptoOp , cryptoAlg , keyLength , msgType string ) string {
778
+ func createCryptoPcktCfg (cryptoOp , cryptoAlg , keyLength , msgType string , accl bool ) string {
777
779
cryptoVec := []string {cryptoOp , cryptoAlg , keyLength }
778
780
opCode := strings .Join (cryptoVec ,"-" )
779
- rtd := map [string ]string {"processOp " : msgType }
780
- tcd := map [string ]string {"processOp" : opCode }
781
+ rtd := map [string ]string {"encryptOp " : msgType , "decryptOp" : msgType }
782
+ tcd := map [string ]string {"encryptOp" : opCode , "decryptOp" : opCode }
781
783
empty := make (map [string ]string )
782
- return createProcessPcktCfg (rtd , tcd , empty , empty )
784
+ return createProcessPcktCfg (rtd , tcd , empty , empty , accl )
783
785
}
784
786
785
787
func createFinishCfg () string {
0 commit comments