c a r g o   :           C h e c k i n g   q t o k e n   v 0 . 1 . 0   
 
 ( C : \ U s e r s \ s s a m e \ D o c u m e n t s \ Q u a n t u m S e c \ q t o k e n ) 
 
 A t   l i n e : 1   c h a r : 1 
 
 +   c a r g o   c h e c k   >   e r r o r s . t x t   2 > & 1 
 
 +   ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
 
         +   C a t e g o r y I n f o                     :   N o t S p e c i f i e d :   (           
 
       C h e c k i n g   q t . . . n t u m S e c \ q t o k e n ) : S t r i n g )   [ ] ,   R e m     
 
     o t e E x c e p t i o n 
 
         +   F u l l y Q u a l i f i e d E r r o r I d   :   N a t i v e C o m m a n d E r r o r 
 
   
 
 e r r o r [ E 0 4 3 2 ] :   u n r e s o l v e d   i m p o r t   
 
 ` p q c r y p t o _ t r a i t s : : k e m : : K e y p a i r ` 
 
   - - >   s r c \ k e y s . r s : 3 : 2 8 
 
     | 
 
 3   |   u s e   p q c r y p t o _ t r a i t s : : k e m : : { K e y p a i r   a s   
 
 K e m K e y p a i r T r a i t ,   P u b l i c K e y   a s   K e m P u b l i c K e y T r a i t ,   
 
 S e c r e t K e y   a s   K e m S e c r e t K e y T r a i t } ; 
 
     |                                                         
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   n o   ` K e y p a i r `   i n   ` k e m ` 
 
 
 
 e r r o r [ E 0 3 6 5 ] :   ` m l k e m 7 6 8 `   i s   p r i v a t e ,   a n d   c a n n o t   
 
 b e   r e - e x p o r t e d 
 
   - - >   s r c \ c r y p t o . r s : 8 : 9 
 
     | 
 
 8   |   p u b   u s e   m l k e m 7 6 8   a s   k e m _ a l g ; 
 
     |                   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   r e - e x p o r t   o f   
 
 p r i v a t e   ` m l k e m 7 6 8 ` 
 
     | 
 
     =   n o t e :   c o n s i d e r   d e c l a r i n g   t y p e   o r   m o d u l e   
 
 ` m l k e m 7 6 8 `   w i t h   ` p u b ` 
 
 
 
 e r r o r [ E 0 3 6 5 ] :   ` m l d s a 6 5 `   i s   p r i v a t e ,   a n d   c a n n o t   b e   
 
 r e - e x p o r t e d 
 
   - - >   s r c \ c r y p t o . r s : 9 : 9 
 
     | 
 
 9   |   p u b   u s e   m l d s a 6 5   a s   s i g n _ a l g ; 
 
     |                   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   r e - e x p o r t   o f   
 
 p r i v a t e   ` m l d s a 6 5 ` 
 
     | 
 
     =   n o t e :   c o n s i d e r   d e c l a r i n g   t y p e   o r   m o d u l e   
 
 ` m l d s a 6 5 `   w i t h   ` p u b ` 
 
 
 
 e r r o r [ E 0 4 3 2 ] :   u n r e s o l v e d   i m p o r t   
 
 ` p q c r y p t o _ t r a i t s : : s i g n : : K e y p a i r ` 
 
   - - >   s r c \ k e y s . r s : 4 : 2 9 
 
     | 
 
 4   |   u s e   p q c r y p t o _ t r a i t s : : s i g n : : { K e y p a i r   a s   
 
 S i g n K e y p a i r T r a i t ,   P u b l i c K e y   a s   
 
 S i g n P u b l i c K e y T r a i t ,   S e c r e t K e y   a s   
 
 S i g n S e c r e t K e y T r a i t } ; 
 
     |                                                           
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   n o   ` K e y p a i r `   i n   ` s i g n ` 
 
 
 
 e r r o r [ E 0 4 3 3 ] :   f a i l e d   t o   r e s o l v e :   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` k e m _ a l g ` 
 
       - - >   s r c \ k e y s . r s : 1 8 8 : 1 4 
 
         | 
 
 1 8 8   |           l e t   k p   =   k e m _ a l g : : k e y p a i r ( ) ; 
 
         |                             ^ ^ ^ ^ ^ ^ ^   u s e   o f   u n r e s o l v e d   
 
 m o d u l e   o r   u n l i n k e d   c r a t e   ` k e m _ a l g ` 
 
         | 
 
         =   h e l p :   i f   y o u   w a n t e d   t o   u s e   a   c r a t e   n a m e d   
 
 ` k e m _ a l g ` ,   u s e   ` c a r g o   a d d   k e m _ a l g `   t o   a d d   i t   t o   
 
 y o u r   ` C a r g o . t o m l ` 
 
         =   n o t e :   m o d u l e   ` c r a t e : : c r y p t o : : k e m _ a l g `   
 
 e x i s t s   b u t   i s   i n a c c e s s i b l e 
 
 
 
 e r r o r [ E 0 4 3 3 ] :   f a i l e d   t o   r e s o l v e :   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s i g n _ a l g ` 
 
       - - >   s r c \ k e y s . r s : 1 9 3 : 1 4 
 
         | 
 
 1 9 3   |           l e t   k p   =   s i g n _ a l g : : k e y p a i r ( ) ; 
 
         |                             ^ ^ ^ ^ ^ ^ ^ ^   u s e   o f   u n r e s o l v e d   
 
 m o d u l e   o r   u n l i n k e d   c r a t e   ` s i g n _ a l g ` 
 
         | 
 
         =   h e l p :   i f   y o u   w a n t e d   t o   u s e   a   c r a t e   n a m e d   
 
 ` s i g n _ a l g ` ,   u s e   ` c a r g o   a d d   s i g n _ a l g `   t o   a d d   i t   t o   
 
 y o u r   ` C a r g o . t o m l ` 
 
         =   n o t e :   m o d u l e   ` c r a t e : : c r y p t o : : s i g n _ a l g `   
 
 e x i s t s   b u t   i s   i n a c c e s s i b l e 
 
 
 
 e r r o r [ E 0 6 0 3 ] :   m o d u l e   i m p o r t   ` s i g n _ a l g `   i s   p r i v a t e 
 
     - - >   s r c \ t o k e n \ s i g n e d . r s : 5 : 2 1 
 
       | 
 
   5   |   u s e   c r a t e : : c r y p t o : : { s i g n _ a l g ,   S i g n a t u r e } ; 
 
       |                                           ^ ^ ^ ^ ^ ^ ^ ^   p r i v a t e   m o d u l e   
 
 i m p o r t 
 
       | 
 
 n o t e :   t h e   m o d u l e   i m p o r t   ` s i g n _ a l g `   i s   d e f i n e d   
 
 h e r e . . . 
 
     - - >   s r c \ c r y p t o . r s : 9 : 9 
 
       | 
 
   9   |   p u b   u s e   m l d s a 6 5   a s   s i g n _ a l g ; 
 
       |                   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 n o t e :   . . . a n d   r e f e r s   t o   t h e   m o d u l e   i m p o r t   
 
 ` m l d s a 6 5 `   w h i c h   i s   d e f i n e d   h e r e . . . 
 
     - - >   s r c \ c r y p t o . r s : 2 : 5 
 
       | 
 
   2   |   u s e   p q c r y p t o _ m l d s a : : m l d s a 6 5 ; 
 
       |           ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 n o t e :   . . . a n d   r e f e r s   t o   t h e   m o d u l e   ` m l d s a 6 5 `   w h i c h   
 
 i s   d e f i n e d   h e r e 
 
     - - >   C : \ U s e r s \ s s a m e \ . c a r g o \ r e g i s t r y \ s r c \ i n d e x . c r a 
 
 t e s . i o - 1 9 4 9 c f 8 c 6 b 5 b 5 5 7 f \ p q c r y p t o - m l d s a - 0 . 1 . 2 \ s r c \ l 
 
 i b . r s : 2 5 : 1 
 
       | 
 
 2 5   |   p u b   m o d   m l d s a 6 5 ; 
 
       |   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   y o u   c o u l d   i m p o r t   t h i s   
 
 d i r e c t l y 
 
 h e l p :   i m p o r t   ` s i g n _ a l g `   d i r e c t l y 
 
       | 
 
   5   -   u s e   c r a t e : : c r y p t o : : { s i g n _ a l g ,   S i g n a t u r e } ; 
 
   5   +   u s e   c r a t e : : c r y p t o : : { p q c r y p t o _ m l d s a : : m l d s a 6 5 ,   
 
 S i g n a t u r e } ; 
 
       | 
 
 
 
 e r r o r [ E 0 6 0 3 ] :   m o d u l e   i m p o r t   ` k e m _ a l g `   i s   p r i v a t e 
 
     - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 5 : 2 1 
 
       | 
 
   5   |   u s e   c r a t e : : c r y p t o : : { k e m _ a l g } ; 
 
       |                                           ^ ^ ^ ^ ^ ^ ^   p r i v a t e   m o d u l e   
 
 i m p o r t 
 
       | 
 
 n o t e :   t h e   m o d u l e   i m p o r t   ` k e m _ a l g `   i s   d e f i n e d   
 
 h e r e . . . 
 
     - - >   s r c \ c r y p t o . r s : 8 : 9 
 
       | 
 
   8   |   p u b   u s e   m l k e m 7 6 8   a s   k e m _ a l g ; 
 
       |                   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 n o t e :   . . . a n d   r e f e r s   t o   t h e   m o d u l e   i m p o r t   
 
 ` m l k e m 7 6 8 `   w h i c h   i s   d e f i n e d   h e r e . . . 
 
     - - >   s r c \ c r y p t o . r s : 1 : 5 
 
       | 
 
   1   |   u s e   p q c r y p t o _ m l k e m : : m l k e m 7 6 8 ; 
 
       |           ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 n o t e :   . . . a n d   r e f e r s   t o   t h e   m o d u l e   ` m l k e m 7 6 8 `   
 
 w h i c h   i s   d e f i n e d   h e r e 
 
     - - >   C : \ U s e r s \ s s a m e \ . c a r g o \ r e g i s t r y \ s r c \ i n d e x . c r a 
 
 t e s . i o - 1 9 4 9 c f 8 c 6 b 5 b 5 5 7 f \ p q c r y p t o - m l k e m - 0 . 1 . 1 \ s r c \ l 
 
 i b . r s : 2 6 : 1 
 
       | 
 
 2 6   |   p u b   m o d   m l k e m 7 6 8 ; 
 
       |   ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   y o u   c o u l d   i m p o r t   t h i s   
 
 d i r e c t l y 
 
 h e l p :   i m p o r t   ` k e m _ a l g `   d i r e c t l y 
 
       | 
 
   5   -   u s e   c r a t e : : c r y p t o : : { k e m _ a l g } ; 
 
   5   +   u s e   
 
 c r a t e : : c r y p t o : : { p q c r y p t o _ m l k e m : : m l k e m 7 6 8 } ; 
 
       | 
 
 
 
 w a r n i n g :   u n u s e d   i m p o r t s :   ` C i p h e r t e x t ` ,   ` P u b l i c K e y   
 
 a s   K e m P u b l i c K e y ` ,   ` S e c r e t K e y   a s   K e m S e c r e t K e y ` ,   
 
 a n d   ` S h a r e d S e c r e t ` 
 
   - - >   s r c \ c r y p t o . r s : 3 : 2 8 
 
     | 
 
 3   |   u s e   p q c r y p t o _ t r a i t s : : k e m : : { C i p h e r t e x t ,   
 
 S h a r e d S e c r e t ,   P u b l i c K e y   a s   K e m P u b l i c K e y ,   
 
 S e c r e t K e y   a s   K e m S e c r e t K e y } ; 
 
     |                                                         ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
     | 
 
     =   n o t e :   ` # [ w a r n ( u n u s e d _ i m p o r t s ) ] `   ( p a r t   o f   
 
 ` # [ w a r n ( u n u s e d ) ] ` )   o n   b y   d e f a u l t 
 
 
 
 w a r n i n g :   u n u s e d   i m p o r t s :   ` D e t a c h e d S i g n a t u r e ` ,   
 
 ` P u b l i c K e y   a s   S i g n P u b l i c K e y ` ,   ` S e c r e t K e y   a s   
 
 S i g n S e c r e t K e y ` ,   a n d   ` S i g n e d M e s s a g e ` 
 
   - - >   s r c \ c r y p t o . r s : 4 : 2 9 
 
     | 
 
 4   |   u s e   p q c r y p t o _ t r a i t s : : s i g n : : { P u b l i c K e y   a s   
 
 S i g n P u b l i c K e y ,   S e c r e t K e y   a s   S i g n S e c r e t K e y ,   
 
 S i g n e d M e s s a g e ,   D e t a c h e d S i g n a t u r e } ; 
 
     |                                                           
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^     
 
 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 
 
 w a r n i n g :   u n u s e d   i m p o r t :   ` A e a d I n P l a c e ` 
 
   - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 7 : 6 2 
 
     | 
 
 7   |   u s e   c h a c h a 2 0 p o l y 1 3 0 5 : : { X C h a C h a 2 0 P o l y 1 3 0 5 ,   
 
 K e y I n i t ,   A e a d C o r e ,   A e a d I n P l a c e } ; 
 
     |                                                                                               
 
                               ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
 
 
 
 e r r o r [ E 0 4 3 3 ] :   f a i l e d   t o   r e s o l v e :   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s e r d e _ j s o n ` 
 
     - - >   s r c \ t o k e n \ s i g n e d . r s : 3 1 : 2 7 
 
       | 
 
 3 1   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e |   
 
 E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                       ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s e r d e _ j s o n ` 
 
       | 
 
       =   h e l p :   i f   y o u   w a n t e d   t o   u s e   a   c r a t e   n a m e d   
 
 ` s e r d e _ j s o n ` ,   u s e   ` c a r g o   a d d   s e r d e _ j s o n `   t o   a d d   
 
 i t   t o   y o u r   ` C a r g o . t o m l ` 
 
 
 
 e r r o r [ E 0 2 8 2 ] :   t y p e   a n n o t a t i o n s   n e e d e d 
 
     - - >   s r c \ t o k e n \ s i g n e d . r s : 3 1 : 6 7 
 
       | 
 
 3 1   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e |   
 
 E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                                                             
 
                                           ^                                               -   
 
 t y p e   m u s t   b e   k n o w n   a t   t h i s   p o i n t 
 
       | 
 
 h e l p :   c o n s i d e r   g i v i n g   t h i s   c l o s u r e   p a r a m e t e r   a n   
 
 e x p l i c i t   t y p e 
 
       | 
 
 3 1   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e :   / *   
 
 T y p e   * / |   E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                                                             
 
                                             + + + + + + + + + + + + 
 
 
 
 e r r o r [ E 0 4 3 3 ] :   f a i l e d   t o   r e s o l v e :   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s e r d e _ j s o n ` 
 
     - - >   s r c \ t o k e n \ s i g n e d . r s : 6 9 : 3 0 
 
       | 
 
 6 9   |                   l e t   h e a d e r :   H e a d e r   =   
 
 s e r d e _ j s o n : : f r o m _ s l i c e ( & h e a d e r _ b y t e s ) . m a p _ e r r ( | _ |   
 
 E r r o r : : I n v a l i d T o k e n F o r m a t ) ? ; 
 
       |                                                             ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   u s e   
 
 o f   u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   
 
 ` s e r d e _ j s o n ` 
 
       | 
 
       =   h e l p :   i f   y o u   w a n t e d   t o   u s e   a   c r a t e   n a m e d   
 
 ` s e r d e _ j s o n ` ,   u s e   ` c a r g o   a d d   s e r d e _ j s o n `   t o   a d d   
 
 i t   t o   y o u r   ` C a r g o . t o m l ` 
 
 
 
 e r r o r [ E 0 4 3 3 ] :   f a i l e d   t o   r e s o l v e :   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s e r d e _ j s o n ` 
 
     - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 3 4 : 2 7 
 
       | 
 
 3 4   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e |   
 
 E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                       ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   u s e   o f   
 
 u n r e s o l v e d   m o d u l e   o r   u n l i n k e d   c r a t e   ` s e r d e _ j s o n ` 
 
       | 
 
       =   h e l p :   i f   y o u   w a n t e d   t o   u s e   a   c r a t e   n a m e d   
 
 ` s e r d e _ j s o n ` ,   u s e   ` c a r g o   a d d   s e r d e _ j s o n `   t o   a d d   
 
 i t   t o   y o u r   ` C a r g o . t o m l ` 
 
 
 
 e r r o r [ E 0 2 8 2 ] :   t y p e   a n n o t a t i o n s   n e e d e d 
 
     - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 3 4 : 6 7 
 
       | 
 
 3 4   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e |   
 
 E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                                                             
 
                                           ^                                               -   
 
 t y p e   m u s t   b e   k n o w n   a t   t h i s   p o i n t 
 
       | 
 
 h e l p :   c o n s i d e r   g i v i n g   t h i s   c l o s u r e   p a r a m e t e r   a n   
 
 e x p l i c i t   t y p e 
 
       | 
 
 3 4   |                   l e t   h e a d e r _ j s o n   =   
 
 s e r d e _ j s o n : : t o _ s t r i n g ( & h e a d e r ) . m a p _ e r r ( | e :   / *   
 
 T y p e   * / |   E r r o r : : E n c o d i n g E r r o r ( e . t o _ s t r i n g ( ) ) ) ? ; 
 
       |                                                                                             
 
                                             + + + + + + + + + + + + 
 
 
 
 e r r o r [ E 0 2 8 2 ] :   t y p e   a n n o t a t i o n s   n e e d e d 
 
     - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 4 2 : 2 3 
 
       | 
 
 4 2   |                   
 
 h a s h e r . u p d a t e ( s h a r e d _ s e c r e t . a s _ b y t e s ( ) ) ; 
 
       |                                               ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   c a n n o t   
 
 i n f e r   t y p e 
 
 
 
 e r r o r [ E 0 5 9 9 ] :   n o   m e t h o d   n a m e d   ` e n c r y p t `   f o u n d   f o r   
 
 s t r u c t   ` C h a C h a P o l y 1 3 0 5 < C ,   N > `   i n   t h e   c u r r e n t   s c o p e 
 
       - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 5 6 : 3 9 
 
         | 
 
   5 6   |                   l e t   m _ e n c r y p t e d _ d a t a   =   
 
 c i p h e r . e n c r y p t ( & n o n c e ,   p a y l o a d ) . m a p _ e r r ( | _ |   
 
 E r r o r : : E n c r y p t E r r o r ) ? ; 
 
         |                                                                               
 
 ^ ^ ^ ^ ^ ^ ^ 
 
         | 
 
       : : :   C : \ U s e r s \ s s a m e \ . c a r g o \ r e g i s t r y \ s r c \ i n d e x . c r 
 
 a t e s . i o - 1 9 4 9 c f 8 c 6 b 5 b 5 5 7 f \ a e a d - 0 . 5 . 2 \ s r c \ l i b . r s : 1 9 1 
 
 : 8 
 
         | 
 
 1 9 1   |           f n   e n c r y p t < ' m s g ,   ' a a d > ( 
 
         |                 - - - - - - -   t h e   m e t h o d   i s   a v a i l a b l e   f o r   ` 
 
 C h a C h a P o l y 1 3 0 5 < c i p h e r : : s t r e a m _ w r a p p e r : : S t r e a m C i p h e 
 
 r C o r e W r a p p e r < c h a c h a 2 0 : : x c h a c h a : : X C h a C h a C o r e < U I n t < U 
 
 I n t < U I n t < U I n t < U T e r m ,   B 1 > ,   B 0 > ,   B 1 > ,   B 0 > > > ,   
 
 U I n t < U I n t < U I n t < U I n t < U I n t < U T e r m ,   B 1 > ,   B 1 > ,   B 0 > ,   
 
 B 0 > ,   B 0 > > `   h e r e 
 
         | 
 
         =   h e l p :   i t e m s   f r o m   t r a i t s   c a n   o n l y   b e   u s e d   i f   
 
 t h e   t r a i t   i s   i n   s c o p e 
 
 h e l p :   t r a i t   ` A e a d `   w h i c h   p r o v i d e s   ` e n c r y p t `   i s   
 
 i m p l e m e n t e d   b u t   n o t   i n   s c o p e ;   p e r h a p s   y o u   w a n t   t o   
 
 i m p o r t   i t 
 
         | 
 
     1   +   u s e   c h a c h a 2 0 p o l y 1 3 0 5 : : a e a d : : A e a d ; 
 
         | 
 
 h e l p :   t h e r e   i s   a   m e t h o d   ` d e c r y p t `   w i t h   a   s i m i l a r   
 
 n a m e 
 
         | 
 
   5 6   -                   l e t   m _ e n c r y p t e d _ d a t a   =   
 
 c i p h e r . e n c r y p t ( & n o n c e ,   p a y l o a d ) . m a p _ e r r ( | _ |   
 
 E r r o r : : E n c r y p t E r r o r ) ? ; 
 
   5 6   +                   l e t   m _ e n c r y p t e d _ d a t a   =   
 
 c i p h e r . d e c r y p t ( & n o n c e ,   p a y l o a d ) . m a p _ e r r ( | _ |   
 
 E r r o r : : E n c r y p t E r r o r ) ? ; 
 
         | 
 
 
 
 e r r o r [ E 0 2 8 2 ] :   t y p e   a n n o t a t i o n s   n e e d e d 
 
     - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 6 2 : 4 9 
 
       | 
 
 6 2   |                   l e t   k e m _ c t _ b 6 4   =   
 
 U R L _ S A F E _ N O _ P A D . e n c o d e ( k e m _ c i p h e r t e x t . a s _ b y t e s ( ) ) ; 
 
       |                                                                                             
 
       ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^   c a n n o t   i n f e r   t y p e 
 
 
 
 e r r o r [ E 0 5 9 9 ] :   n o   m e t h o d   n a m e d   ` d e c r y p t `   f o u n d   f o r   
 
 s t r u c t   ` C h a C h a P o l y 1 3 0 5 < C ,   N > `   i n   t h e   c u r r e n t   s c o p e 
 
       - - >   s r c \ t o k e n \ e n c r y p t e d . r s : 1 0 0 : 3 2 
 
         | 
 
 1 0 0   |                   l e t   p l a i n t e x t   =   
 
 c i p h e r . d e c r y p t ( n o n c e ,   c i p h e r t e x t _ d a t a . a s _ r e f ( ) ) 
 
         |                                                                 ^ ^ ^ ^ ^ ^ ^ 
 
         | 
 
       : : :   C : \ U s e r s \ s s a m e \ . c a r g o \ r e g i s t r y \ s r c \ i n d e x . c r 
 
 a t e s . i o - 1 9 4 9 c f 8 c 6 b 5 b 5 5 7 f \ a e a d - 0 . 5 . 2 \ s r c \ l i b . r s : 2 1 4 
 
 : 8 
 
         | 
 
 2 1 4   |           f n   d e c r y p t < ' m s g ,   ' a a d > ( 
 
         |                 - - - - - - -   t h e   m e t h o d   i s   a v a i l a b l e   f o r   ` 
 
 C h a C h a P o l y 1 3 0 5 < c i p h e r : : s t r e a m _ w r a p p e r : : S t r e a m C i p h e 
 
 r C o r e W r a p p e r < c h a c h a 2 0 : : x c h a c h a : : X C h a C h a C o r e < U I n t < U 
 
 I n t < U I n t < U I n t < U T e r m ,   B 1 > ,   B 0 > ,   B 1 > ,   B 0 > > > ,   
 
 U I n t < U I n t < U I n t < U I n t < U I n t < U T e r m ,   B 1 > ,   B 1 > ,   B 0 > ,   
 
 B 0 > ,   B 0 > > `   h e r e 
 
         | 
 
         =   h e l p :   i t e m s   f r o m   t r a i t s   c a n   o n l y   b e   u s e d   i f   
 
 t h e   t r a i t   i s   i n   s c o p e 
 
 h e l p :   t r a i t   ` A e a d `   w h i c h   p r o v i d e s   ` d e c r y p t `   i s   
 
 i m p l e m e n t e d   b u t   n o t   i n   s c o p e ;   p e r h a p s   y o u   w a n t   t o   
 
 i m p o r t   i t 
 
         | 
 
     1   +   u s e   c h a c h a 2 0 p o l y 1 3 0 5 : : a e a d : : A e a d ; 
 
         | 
 
 h e l p :   t h e r e   i s   a   m e t h o d   ` e n c r y p t `   w i t h   a   s i m i l a r   
 
 n a m e 
 
         | 
 
 1 0 0   -                   l e t   p l a i n t e x t   =   
 
 c i p h e r . d e c r y p t ( n o n c e ,   c i p h e r t e x t _ d a t a . a s _ r e f ( ) ) 
 
 1 0 0   +                   l e t   p l a i n t e x t   =   
 
 c i p h e r . e n c r y p t ( n o n c e ,   c i p h e r t e x t _ d a t a . a s _ r e f ( ) ) 
 
         | 
 
 
 
 S o m e   e r r o r s   h a v e   d e t a i l e d   e x p l a n a t i o n s :   E 0 2 8 2 ,   
 
 E 0 3 6 5 ,   E 0 4 3 2 ,   E 0 4 3 3 ,   E 0 5 9 9 ,   E 0 6 0 3 . 
 
 F o r   m o r e   i n f o r m a t i o n   a b o u t   a n   e r r o r ,   t r y   ` r u s t c   
 
 - - e x p l a i n   E 0 2 8 2 ` . 
 
 w a r n i n g :   ` q t o k e n `   ( l i b )   g e n e r a t e d   3   w a r n i n g s 
 
 e r r o r :   c o u l d   n o t   c o m p i l e   ` q t o k e n `   ( l i b )   d u e   t o   1 7   
 
 p r e v i o u s   e r r o r s ;   3   w a r n i n g s   e m i t t e d 
 
 